TLC for EXPLAIN ANALYZE (parallel query and loops)

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема TLC for EXPLAIN ANALYZE (parallel query and loops)
Дата
Msg-id CAKFQuwZjfGv8Q3xTwgtoqXzN04YvtsQYWduGpKAFbnWt_nS2PQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
<div dir="ltr"><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif"><a
href="https://www.postgresql.org/docs/9.6/static/using-explain.html">https://www.postgresql.org/docs/9.6/static/using-explain.html</a></font><br
/></div><divclass="gmail_default" style=""><font face="arial, helvetica, sans-serif"><br /></font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif">Existing...</font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif"><br /></font></div><div class="gmail_default"
style=""><fontface="arial, helvetica, sans-serif">14.1.2 Explain Analyze</font></div><div class="gmail_default"
style=""><fontface="arial, helvetica, sans-serif">[...]</font></div><div class="gmail_default" style=""><font
face="arial,helvetica, sans-serif">"""</font></div><div class="gmail_default" style=""><font face="arial, helvetica,
sans-serif">Insome query plans, it is possible for a subplan node to be executed more than once. For example, the inner
indexscan will be executed once per outer row in the above nested-loop plan. In such cases, the loops value reports the
totalnumber of executions of the node, and the actual time and rows values shown are averages per-execution. This is
doneto make the numbers comparable with the way that the cost estimates are shown. Multiply by the loops value to get
thetotal time actually spent in the node. In the above example, we spent a total of 0.220 milliseconds executing the
indexscans on tenk2.<br /></font></div><div class="gmail_default" style=""><font face="arial, helvetica,
sans-serif">"""</font></div><divclass="gmail_default" style=""><font face="arial, helvetica, sans-serif"><br
/></font></div><divclass="gmail_default" style=""><font face="arial, helvetica, sans-serif">Additional topics to cover
here(somewhere in this region)...</font></div><div class="gmail_default" style=""><font face="arial, helvetica,
sans-serif"><br/></font></div><div class="gmail_default" style=""><font face="arial, helvetica,
sans-serif">Parallel-executedqueries executed in workers also result in an increase in the number of loops.  The total
loopcount will be equal to the number of workers used, plus 1 if the leader contributed to retrieving rows.  Note that,
presently,the leader's contributions are not detailed and can only be imputed from the total for the node and the
detailof the workers.</font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif">[other
detailgoes here - the whole block could be placed subsequent to the inheritance example].</font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif"><br /></font></div><div class="gmail_default"
style=""><fontface="arial, helvetica, sans-serif"><br /></font></div><div class="gmail_default" style=""><font
face="arial,helvetica, sans-serif">[Possibly make a shorter form of this into a note...]</font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif">A nested-loop execution will often result in
exactly1 row being returned per loop.  In the parallel case, however, and especially when performing parallel
sequentialscans with a highly-restrictive filter, it is possible that few rows are returned.  For instance, a parallel
sequentialscan on a unique value will return a single row but might, including the leader, use 3 scans/loops to perform
thework.  In this case the average value per loop would be 0.333+ - which is rounded down to zero since rows is
expressedas an integer.  In any case when loops > 1 it can be necessary (though not always sufficient) to examine
theparent node to discover the total number of records returned by the child node.</font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif"><br /></font></div><div class="gmail_default"
style=""><fontface="arial, helvetica, sans-serif">I'm sure I have some level of imprecision here but hopefully this is
enoughto start.</font></div><div class="gmail_default" style=""><font face="arial, helvetica, sans-serif"><br
/></font></div><divclass="gmail_default" style=""><font face="arial, helvetica, sans-serif">David J.</font></div><div
class="gmail_default"style=""><font face="arial, helvetica, sans-serif"><br /></font></div></div> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vibhor Kumar
Дата:
Сообщение: Re: ToDo: API for SQL statement execution other than SPI
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Forthcoming SQL standards about JSON and Multi-Dimensional Arrays (FYI)