-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.html
More file actions
374 lines (329 loc) · 14.1 KB
/
database.html
File metadata and controls
374 lines (329 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Database Features - QueryForge</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>💾 Database Features</h1>
<p>Multi-Database Support, SQL Editor, and Query Tools</p>
</header>
<nav class="breadcrumb">
<a href="index.html">Home</a> > Database Features
</nav>
<div class="container">
<section class="doc-section">
<h2>Supported Databases</h2>
<div class="feature-grid">
<div class="feature-box">
<h3>🐘 PostgreSQL</h3>
<ul>
<li>Versions 10+</li>
<li>Full transaction support</li>
<li>EXPLAIN ANALYZE</li>
<li>Schema introspection</li>
<li>Function/trigger support</li>
</ul>
</div>
<div class="feature-box">
<h3>🐬 MySQL</h3>
<ul>
<li>Versions 5.7+, 8.0+</li>
<li>InnoDB transactions</li>
<li>EXPLAIN support</li>
<li>Stored procedures</li>
<li>Trigger management</li>
</ul>
</div>
<div class="feature-box">
<h3>🔶 Oracle</h3>
<ul>
<li>Versions 11g+</li>
<li>PL/SQL support</li>
<li>EXPLAIN PLAN</li>
<li>Package management</li>
<li>Advanced features</li>
</ul>
</div>
</div>
</section>
<section class="doc-section">
<h2>SQL Editor</h2>
<h3>Features</h3>
<ul>
<li><strong>Multiple Tabs:</strong> Work on multiple queries simultaneously</li>
<li><strong>Syntax Highlighting:</strong> SQL keywords, strings, comments</li>
<li><strong>Code Formatting:</strong> Auto-format SQL with proper indentation</li>
<li><strong>Line Numbers:</strong> Easy reference and debugging</li>
<li><strong>Bracket Matching:</strong> Automatic parenthesis matching</li>
<li><strong>Code Folding:</strong> Collapse/expand code blocks</li>
<li><strong>Tab Persistence:</strong> Queries saved across sessions</li>
</ul>
<h3>Keyboard Shortcuts</h3>
<div class="code-block">
Ctrl+Enter Execute query
Ctrl+Shift+F Search everywhere
Ctrl+/ Toggle comment
Tab Indent
Shift+Tab Outdent
</div>
<h3>Query Execution</h3>
<ul>
<li>Execute selected text or entire query</li>
<li>Multiple statements separated by semicolons</li>
<li>Progress indicators for long-running queries</li>
<li>Query cancellation support</li>
<li>Automatic error detection</li>
</ul>
</section>
<section class="doc-section">
<h2>Object Browser</h2>
<h3>Object Types</h3>
<ul>
<li><strong>Tables:</strong> View structure, columns, constraints</li>
<li><strong>Views:</strong> See view definitions and dependencies</li>
<li><strong>Functions:</strong> Browse stored functions and procedures</li>
<li><strong>Indexes:</strong> Index details and statistics</li>
<li><strong>Sequences:</strong> Sequence values and properties</li>
<li><strong>Triggers:</strong> Trigger definitions and timing</li>
</ul>
<h3>Features</h3>
<ul>
<li>Schema grouping with expandable tree</li>
<li>Search across all objects</li>
<li>Object count per type</li>
<li>Quick navigation</li>
<li>View source code/definitions</li>
<li>Metadata display</li>
</ul>
</section>
<section class="doc-section">
<h2>Results Viewer</h2>
<h3>Display Features</h3>
<ul>
<li><strong>Pagination:</strong> 50/100/500/1000 rows per page</li>
<li><strong>Column Sorting:</strong> Click headers to sort ascending/descending</li>
<li><strong>Filtering:</strong> Search across all columns</li>
<li><strong>Row Selection:</strong> Select individual or all rows</li>
<li><strong>Row Limit:</strong> Maximum 10,000 rows per query</li>
</ul>
<h3>Export Options</h3>
<ul>
<li><strong>Excel (.xlsx):</strong> Full formatting and data types</li>
<li><strong>CSV:</strong> Standard comma-separated values</li>
<li><strong>JSON:</strong> Structured data format</li>
<li><strong>Copy as INSERT:</strong> Generate SQL INSERT statements</li>
</ul>
<div class="info-box">
<strong>Export Logging:</strong> All exports are logged with user, timestamp, row count, and format for compliance.
</div>
</section>
<section class="doc-section">
<h2>Query Features</h2>
<h3>EXPLAIN Plans</h3>
<ul>
<li>Visual query execution plans</li>
<li>Cost analysis</li>
<li>Index usage detection</li>
<li>Performance optimization hints</li>
</ul>
<h3>Transaction Management</h3>
<div class="code-block">
BEGIN; Start transaction
COMMIT; Commit changes
ROLLBACK; Undo changes
</div>
<h3>Query History</h3>
<ul>
<li>Recent queries saved</li>
<li>Quick re-execution</li>
<li>Query timestamps</li>
<li>Result row counts</li>
</ul>
</section>
<section class="doc-section">
<h2>DBA Tools</h2>
<h3>Session Monitor</h3>
<ul>
<li>View all active database sessions</li>
<li>See running queries</li>
<li>Kill sessions (with logging)</li>
<li>Auto-refresh every 5 seconds</li>
<li>Session duration and state</li>
</ul>
<h3>Lock Monitor</h3>
<ul>
<li>View all database locks</li>
<li>Identify blocking queries</li>
<li>Lock types and modes</li>
<li>Granted vs waiting locks</li>
<li>Lock holder information</li>
</ul>
<h3>User Management</h3>
<ul>
<li>List all database users/roles</li>
<li>View user privileges</li>
<li>Account status (active/locked)</li>
<li>Role memberships</li>
<li>Connection limits</li>
</ul>
</section>
<section class="doc-section">
<h2>Phase A: Advanced DBA Tools ✨ NEW</h2>
<h3>Emergency Mode</h3>
<p>Critical incident response controls in the DBA Tools header:</p>
<ul>
<li><strong>Read-Only Mode:</strong> One-click toggle to block all write operations</li>
<li><strong>Statement Timeout:</strong> Set 10-second timeout for all queries</li>
<li><strong>Visual Indicators:</strong> Buttons change color when active</li>
<li><strong>Confirmation Required:</strong> All changes require confirmation</li>
<li><strong>Security Logging:</strong> All emergency mode changes logged</li>
</ul>
<div class="warning-box">
<strong>⚠️ Permissions Required:</strong>
<ul>
<li>PostgreSQL: ALTER DATABASE or SUPERUSER</li>
<li>MySQL: SUPER privilege</li>
<li>Oracle: ALTER SYSTEM</li>
</ul>
</div>
<h3>Lock Graph Visualization</h3>
<p>Visual blocking chain analysis in the Locks tab:</p>
<ul>
<li><strong>Blocking Chain Tree:</strong> Visual representation of lock dependencies</li>
<li><strong>Root Blocker:</strong> Identified with red badge</li>
<li><strong>Blocked Sessions:</strong> Shown with orange badges</li>
<li><strong>Query Preview:</strong> See queries for each lock</li>
<li><strong>Depth Indication:</strong> Indentation shows blocking depth</li>
</ul>
<h3>Maintenance Tools</h3>
<p>Daily DBA maintenance in the new Maintenance tab:</p>
<h4>Bloat Analysis</h4>
<ul>
<li>Table bloat percentage calculation</li>
<li>Dead tuple counts</li>
<li>Table size display</li>
<li>Color-coded indicators (red >20%, orange <20%)</li>
<li>One-click VACUUM and ANALYZE buttons</li>
</ul>
<h4>Autovacuum Status</h4>
<ul>
<li>Last vacuum/autovacuum timestamps</li>
<li>Last analyze/autoanalyze timestamps</li>
<li>Vacuum and autovacuum counts</li>
<li>Sorted by most recent activity</li>
</ul>
<div class="warning-box">
<strong>⚠️ VACUUM Warning:</strong> VACUUM operations may briefly lock tables. Always shows confirmation dialog before execution.
</div>
<h3>Performance Monitor</h3>
<p>Query and index analysis in the new Performance tab:</p>
<h4>Top Queries</h4>
<ul>
<li>Top 20 queries by total execution time</li>
<li>Call counts and statistics</li>
<li>Mean, max, and total execution times</li>
<li>Row counts returned</li>
<li>Query preview with full text on hover</li>
</ul>
<h4>Unused Indexes</h4>
<ul>
<li>Indexes with zero scans</li>
<li>Index size display</li>
<li>Excludes primary keys</li>
<li>Sorted by size (largest first)</li>
<li>Candidates for removal</li>
</ul>
<div class="info-box">
<strong>📋 Setup Required:</strong>
<p>Performance Monitor requires pg_stat_statements extension:</p>
<div class="code-block">
CREATE EXTENSION pg_stat_statements;
-- In postgresql.conf:
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.track = all
</div>
<p>Restart PostgreSQL after configuration changes.</p>
</div>
<h3>Permissions Summary</h3>
<table>
<thead>
<tr>
<th>Feature</th>
<th>PostgreSQL</th>
<th>MySQL</th>
<th>Oracle</th>
</tr>
</thead>
<tbody>
<tr>
<td>Emergency Mode</td>
<td>ALTER DATABASE</td>
<td>SUPER</td>
<td>ALTER SYSTEM</td>
</tr>
<tr>
<td>Lock Graph</td>
<td>pg_locks, pg_stat_activity</td>
<td>PROCESS</td>
<td>V$LOCK, V$SESSION</td>
</tr>
<tr>
<td>Maintenance Tools</td>
<td>VACUUM, pg_stat_user_tables</td>
<td>OPTIMIZE TABLE</td>
<td>ANALYZE</td>
</tr>
<tr>
<td>Performance Monitor</td>
<td>pg_stat_statements extension</td>
<td>performance_schema</td>
<td>V$SQL, DBA_HIST_SQLSTAT</td>
</tr>
</tbody>
</table>
</section>
<section class="doc-section">
<h2>Search Everywhere</h2>
<h3>Global Search (Ctrl+Shift+F)</h3>
<ul>
<li>Search across all database objects</li>
<li>Real-time filtering as you type</li>
<li>Search by name, schema, or type</li>
<li>Quick navigation to objects</li>
<li>Visual icons for object types</li>
</ul>
</section>
<section class="doc-section">
<h2>Advanced Features</h2>
<h3>Query Formatting</h3>
<ul>
<li>Automatic SQL beautification</li>
<li>Consistent indentation</li>
<li>Keyword capitalization</li>
<li>Line breaks for readability</li>
</ul>
<h3>Dark/Light Mode</h3>
<ul>
<li>Toggle between themes</li>
<li>Preference saved per user</li>
<li>Optimized for long sessions</li>
<li>Reduced eye strain</li>
</ul>
<h3>Notifications</h3>
<ul>
<li>Success/error messages</li>
<li>Query execution time</li>
<li>Row counts</li>
<li>Auto-dismiss or manual close</li>
</ul>
</section>
</div>
<footer>
<p>© 2026 QueryForge Contributors | <a href="index.html">Back to Documentation Home</a></p>
</footer>
</body>
</html>