EXPLAIN Node Docs?

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема EXPLAIN Node Docs?
Дата
Msg-id 8481E6DC-CFF8-4E1A-ADE4-52ED8691C7B8@kineticode.com
обсуждение исходный текст
Ответы Re: EXPLAIN Node Docs?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hackers,

Is there any place where the contents of EXPLAIN nodes are documented? I'm making a lot of use of the XML format right
nowto figure out what queries sort on what tables and with what columns, but I've had to do a lot of experimentation to
figureout what each type of node contains. 

For example, today I wanted to know what columns were being used in GROUP BY expressions. I poked around our client's
samplequeries till I found one with a GROUP BY expression and EXPLAINed it. It turns out that the Group node doesn't
talkabout columns, but has a Sort subplan node that does. On reflection, this makes sense, and so I just collected data
forall Sort nodes (it wasn't just GROUP BY sorting I needed) got get my results. 

But it would have been a lot easier if the schema for various nodes was documented. I'd like to be able to just look up
thedocumentation for various nodes to see what elements they contain and what subnodes they might have. Would make it a
loteasier. Does such a thing exist? 

On a related note, how difficult would it be to add a list of column names to nodes with Filter elements? Right now I'm
extractingcolumn names by calling regexp_matches() against the filter element, which is kind of brute force. As an
exmple,right now I have 
        <Plan>                                                                           +          <Node-Type>Index
Scan</Node-Type>                                             +
<Parent-Relationship>Outer</Parent-Relationship>                              +
<Scan-Direction>Forward</Scan-Direction>                                      +
<Index-Name>idx_stuff</Index-Name>               +          <Relation-Name>activities</Relation-Name>
                  +          <Alias>a</Alias>                                                               +
<Startup-Cost>0.00</Startup-Cost>                                             +          <Total-Cost>27.97</Total-Cost>
                                               +          <Plan-Rows>1</Plan-Rows>
                +          <Plan-Width>36</Plan-Width>                                                    +
<Index-Cond>(person_id= 78323)</Index-Cond>                                   +          <Filter>(((SubPlan 1) > 0)
OR(category_id <> 15))</Filter>           + 

Would be nice if there was an additional element with something like
         <Columns>category_id</Columns>

Thanks,

David




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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Extreme bloating of intarray GiST indexes
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: "stored procedures"