You've already forked explain.depesz.com
mirror of
https://gitlab.com/depesz/explain.depesz.com.git
synced 2025-11-27 22:59:08 +02:00
132 lines
7.2 KiB
Plaintext
Executable File
132 lines
7.2 KiB
Plaintext
Executable File
% layout 'default';
|
|
|
|
% my $title = 'New explain';
|
|
% $title = 'New optimization for plan #' . stash('original_plan_id') if stash('optimization');
|
|
% title $title;
|
|
|
|
<h1><%= $title =%></h1>
|
|
|
|
% if ( stash( 'message' ) ) {
|
|
<div class="message">
|
|
<p class="message"><%= stash( 'message' ) =%></p>
|
|
% if ( stash( 'details' ) ) {
|
|
<p class="details"><%= stash( 'details' ) =%></p>
|
|
% }
|
|
<p class="hint">You might want to <a href="<%= url_for 'contact' %>">contact</a> me if you think that the problem is on <a href="http://explain.depesz.com/">explain.depesz.com</a> side.</p>
|
|
</div>
|
|
% }
|
|
|
|
% if ( flash( 'message' ) ) {
|
|
<div class="message">
|
|
<p class="message"><%= flash( 'message' ) =%></p>
|
|
</div>
|
|
% }
|
|
|
|
<form id="new-explain" method="post" action="<%= url_for 'new-explain' %>">
|
|
|
|
<div class="fe fe-first fe_plan">
|
|
<label for="title">Optional title for plan:</label>
|
|
% if ( stash('optimization') ) {
|
|
% my $new_title = "Optimization for: ";
|
|
% $new_title .= stash('original_title') . ";" if stash('original_title');
|
|
% $new_title .= " plan #" . stash('original_plan_id');
|
|
<input id="title" name="title" value="<%= $new_title %>"/>
|
|
<input id="optimization_for" name="optimization_for" type="hidden" value="<%= stash('original_plan_id') %>"/>
|
|
% } else {
|
|
<input id="title" name="title" class="auto-hint" title="Optional title"/>
|
|
% }
|
|
|
|
<label for="plan">Paste output of <code><a href="https://www.postgresql.org/docs/current/sql-explain.html">EXPLAIN (ANALYZE, BUFFERS, ...)</a> <em>your query</em>;</code> here:</label>
|
|
<textarea id="plan" name="plan" class="auto-hint" title="For example:
|
|
=> EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM some_view WHERE nspname not in ('pg_catalog', 'information_schema') order by 1, 2, 3;
|
|
QUERY PLAN
|
|
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
Sort (cost=291.79..293.15 rows=544 width=224) (actual time=60.754..60.760 rows=69 loops=1)
|
|
Sort Key: n.nspname, p.proname, (pg_get_function_arguments(p.oid))
|
|
Sort Method: quicksort Memory: 38kB
|
|
Buffers: shared hit=97
|
|
-> Hash Join (cost=1.08..223.93 rows=544 width=224) (actual time=11.679..60.696 rows=69 loops=1)
|
|
Hash Cond: (p.pronamespace = n.oid)
|
|
Buffers: shared hit=97
|
|
-> Seq Scan on pg_proc p (cost=0.00..210.17 rows=1087 width=73) (actual time=0.067..59.669 rows=3320 loops=1)
|
|
Filter: pg_function_is_visible(oid)
|
|
Rows Removed by Filter: 12
|
|
Buffers: shared hit=96
|
|
-> Hash (cost=1.06..1.06 rows=2 width=68) (actual time=0.011..0.011 rows=2 loops=1)
|
|
Buckets: 1024 Batches: 1 Memory Usage: 9kB
|
|
Buffers: shared hit=1
|
|
-> Seq Scan on pg_namespace n (cost=0.00..1.06 rows=2 width=68) (actual time=0.004..0.006 rows=2 loops=1)
|
|
Filter: ((nspname <> 'pg_catalog'::name) AND (nspname <> 'information_schema'::name))
|
|
Rows Removed by Filter: 2
|
|
Buffers: shared hit=1
|
|
Planning:
|
|
Buffers: shared hit=4
|
|
Planning Time: 0.288 ms
|
|
Execution Time: 60.802 ms
|
|
(22 rows)"></textarea>
|
|
|
|
<label for="query">Optionally paste your query here:</label>
|
|
<textarea id="query" name="query" class="auto-hint" title="For example:
|
|
SELECT a, b
|
|
FROM c
|
|
WHERE d > now() - '5 minutes'::interval;"></textarea>
|
|
|
|
<label for="comments">Optionally add some comments (such as table definitions) here:</label>
|
|
<textarea id="comments" name="comments" class="auto-hint" title="For example:
|
|
$ \d pg_proc
|
|
Table "pg_catalog.pg_proc"
|
|
Column │ Type │ Collation │ Nullable │ Default
|
|
─────────────────┼──────────────┼───────────┼──────────┼─────────
|
|
oid │ oid │ │ not null │
|
|
proname │ name │ │ not null │
|
|
pronamespace │ oid │ │ not null │
|
|
proowner │ oid │ │ not null │
|
|
prolang │ oid │ │ not null │
|
|
procost │ real │ │ not null │
|
|
prorows │ real │ │ not null │
|
|
provariadic │ oid │ │ not null │
|
|
prosupport │ regproc │ │ not null │
|
|
prokind │ "char" │ │ not null │
|
|
prosecdef │ boolean │ │ not null │
|
|
proleakproof │ boolean │ │ not null │
|
|
proisstrict │ boolean │ │ not null │
|
|
proretset │ boolean │ │ not null │
|
|
provolatile │ "char" │ │ not null │
|
|
proparallel │ "char" │ │ not null │
|
|
pronargs │ smallint │ │ not null │
|
|
pronargdefaults │ smallint │ │ not null │
|
|
prorettype │ oid │ │ not null │
|
|
proargtypes │ oidvector │ │ not null │
|
|
proallargtypes │ oid[] │ │ │
|
|
proargmodes │ "char"[] │ │ │
|
|
proargnames │ text[] │ C │ │
|
|
proargdefaults │ pg_node_tree │ C │ │
|
|
protrftypes │ oid[] │ │ │
|
|
prosrc │ text │ C │ not null │
|
|
probin │ text │ C │ │
|
|
prosqlbody │ pg_node_tree │ C │ │
|
|
proconfig │ text[] │ C │ │
|
|
proacl │ aclitem[] │ │ │
|
|
Indexes:
|
|
"pg_proc_oid_index" PRIMARY KEY, btree (oid)
|
|
"pg_proc_proname_args_nsp_index" UNIQUE CONSTRAINT, btree (proname, proargtypes, pronamespace)
|
|
"></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="fe fe_is_public">
|
|
<label for="is_public">I want this plan to be visible on the <a href="<%= url_for 'history' %>" title="link to: history">history</a> page.</label>
|
|
<input type="checkbox" class="checkbox" id="is_public" name="is_public" value="1" checked="checked" />
|
|
</div>
|
|
|
|
<div class="fe fe_is_anon">
|
|
<label for="is_anon">I want this plan to be <a href="http://www.depesz.com/index.php/2011/06/11/explain-depesz-com-new-feature-and-some-new-stats/" title="link to: anonymization description">obfuscated</a> before saving. (Note that this makes plans much harder to understand for others, so use only when absolutely necessary.)</label>
|
|
<input type="checkbox" class="checkbox" id="is_anon" name="is_anon" value="1"/>
|
|
</div>
|
|
|
|
<div class="fe fe-last fe-buttons">
|
|
<button type="submit" name="submit_plan" id="submit_plan"><span>Submit</span></button>
|
|
</div>
|
|
|
|
</form>
|