1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2025-12-18 00:17:23 +02:00
Files
explain.depesz.com/templates/controller/help.html.ep
2017-06-13 20:36:45 +02:00

84 lines
4.0 KiB
Plaintext
Executable File

% layout 'default';
% my $title = 'Help';
% title $title;
<h1><%= $title =%></h1>
<p class="slogan"><strong>explain.depesz.com</strong> is a tool for finding real causes for slow queries.</p>
<p>Generally, one would use the <code>EXPLAIN ANALYZE</code> query; and read the output. The problem is
that not all parts of the output are easily understandable by anybody, and it's not always obvious
whether a node that executes in 17.3ms is faster or slower than the one that runs in 100ms - given the
fact that the first one is executed 7 times.</p>
<p>To use the site, simply go to <a href="<%= url_for 'new-explain' %>" title="link to: new explain">first page</a>
and paste there explain analyze output from your psql.</p>
<p>After uploading, you will be directed to a page which shows parsed, and nicely (well, at least
nice for me :) colorized output, to emphasize important parts.</p>
<p>The url for colorized output is persistent, so you can easily show it to
others. For example to those nice guys on the irc channel <em>#postgresql</em> on freenode.</p>
<p>This graph uses 4 colors to mark important things:</p>
<ul class="colors">
<li class="c-1">white background - everything is fine</li>
<li class="c-2">yellow background - given node is worrying</li>
<li class="c-3">brown background - given node is more worrying</li>
<li class="c-4">red background - given node is very worrying</li>
</ul>
<p>The color is chosen based on which mode you use: "<strong>Exclusive</strong>",
"<strong>Inclusive</strong>" or "<strong>Rows X</strong>".</p>
<h2>Exclusive</h2>
<p>This is the total amount of time <a href="http://www.postgresql.org" title="link to PostgreSQL site">PostgreSQL</a> spent
evaluating this node, without time spent in its subnodes. If the node has been executed many times (for example because
of a <code>Nested Loop</code> plan), this time will be correctly multiplied.</p>
<h3>Colors:</h3>
<ul class="colors">
<li class="c-1">white background - is chosen if exclusive time &lt;= 10% of total query time</li>
<li class="c-2">yellow background - is chosen if exclusive time &isin; (10%, 50%&gt; of total query time</li>
<li class="c-3">brown background - is chosen if exclusive time &isin; (50%, 90%&gt; of total query time</li>
<li class="c-4">red background - is chosen if exclusive time &gt; 90% of total query time</li>
</ul>
<h2>Inclusive</h2>
<p>This is just like <strong>Exclusive</strong>, but it doesn't exclude time of subnodes. So, by definition the top node will
have <strong>Inclusive</strong> time equal to the total time of the query.</p>
<h3>Colors:</h3>
<ul class="colors">
<li class="c-1">white background - is chosen if inclusive time &lt;= 10% of total query time</li>
<li class="c-2">yellow background - is chosen if inclusive time &isin; (10%, 50%&gt; of total query time</li>
<li class="c-3">brown background - is chosen if inclusive time &isin; (50%, 90%&gt; of total query time</li>
<li class="c-4">red background - is chosen if inclusive time &gt; 90% of total query time</li>
</ul>
<h2>Rows X</h2>
<p>This value stores information about how big the planner's mistake was when it estimated the return row count.</p>
<p>For example, if planner estimated that a given node will return 230 rows, but it returned 14118 rows, the
error is 14118/230 == 61.4.</p>
<p>It has to be noted that if the numbers were the other way around (estimated 14118, but really only 230), the
<strong>Rows X</strong> would be the same. To show whether planner underestimated or overestimated - there is
an arrow showing either &darr; - if planner underestimated rowcount, or &uarr; if it overestimated.</p>
<h3>Colors:</h3>
<ul class="colors">
<li class="c-1">white background - is chosen if rows-x &lt;= 10</li>
<li class="c-2">yellow background - is chosen if rows-x &isin; (10, 100&gt;</li>
<li class="c-3">brown background - is chosen if rows-x &isin; (100, 1000&gt;</li>
<li class="c-4">red background - is chosen if rows-x &gt; 1000</li>
</ul>