Explain Nodes

Started by David E. Wheelerover 14 years ago5 messages
#1David E. Wheeler
david@kineticode.com

Hackers,

For my [explanation extension](http://pgxn.org/extension/explanation) I wanted to put together a list of node types, since I'm always having to figure them out to decide which nodes I'm interested in. Reading src/backend/commands/explain.c I assembled this list:

    + Aggregate
    + Append
    + Bitmap Heap Scan
    + Bitmap Index Scan
    + BitmapAnd
    + BitmapOr
    + CTE Scan
    + Foreign Scan
    + Function Scan
    + Group
    + Hash
    + Hash Join
    + Index Scan
    + Limit
    + LockRows
    + Materialize
    + Merge Append
    + Merge Join
    + ModifyTable
    + Nested Loop
    + Recursive Union
    + Result
    + Seq Scan
    + SetOp
    + Sort
    + Subquery Scan
    + Tid Scan
    + Unique
    + Values Scan
    + WindowAgg
    + WorkTable Scan

Is that accurate? I was looking at how `sname` was set, but maybe it can be set other ways?

Should a list like this be added to the EXPLAIN docs?

Thanks,

David

#2Peter Geoghegan
peter@2ndquadrant.com
In reply to: David E. Wheeler (#1)
Re: Explain Nodes

The code for all nodes is in src/backend/executor.

I think that you will find it useful to look at the big switch
statements in ExecInitNode() and friends in execProcnode.c .

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

#3David E. Wheeler
david@kineticode.com
In reply to: Peter Geoghegan (#2)
Re: Explain Nodes

On Apr 28, 2011, at 3:02 PM, Peter Geoghegan wrote:

The code for all nodes is in src/backend/executor.

I think that you will find it useful to look at the big switch
statements in ExecInitNode() and friends in execProcnode.c .

Yep, same as what I found in src/backend/commands/explain.c. Thanks. I'll keep using what's in src/backend/commands/explain.c because I'm using the XML format in explanation and so the nodes have human-readable names.

Best,

David

#4Andrew Dunstan
andrew@dunslane.net
In reply to: David E. Wheeler (#3)
Re: Explain Nodes

On 04/28/2011 06:07 PM, David E. Wheeler wrote:

On Apr 28, 2011, at 3:02 PM, Peter Geoghegan wrote:

The code for all nodes is in src/backend/executor.

I think that you will find it useful to look at the big switch
statements in ExecInitNode() and friends in execProcnode.c .

Yep, same as what I found in src/backend/commands/explain.c. Thanks. I'll keep using what's in src/backend/commands/explain.c because I'm using the XML format in explanation and so the nodes have human-readable names.

It's been pointed out before that plugins (like FDWs) can invent their
own explain nodes, so we'll never have a canonical list of such nodes.

cheers

andrew

#5David E. Wheeler
david@kineticode.com
In reply to: Andrew Dunstan (#4)
Re: Explain Nodes

On Apr 28, 2011, at 3:40 PM, Andrew Dunstan wrote:

It's been pointed out before that plugins (like FDWs) can invent their own explain nodes, so we'll never have a canonical list of such nodes.

Oh, interesting. Stil, a list of core nodes is a good 90% solution, IMHO.

Best,

David