Robert Haas <robertmh...@gmail.com> writes:
> There's an awful lot of layers of function calls happening in
> explain.c for no really discernable purpose that I can see.
> ExplainOneQuery() calls either ExplainOneUtility() if it has a utility
> command or ExplainOneQuery_hook() if that's defined or else it plans
> the query and then calls ExplainOnePlan().  ExplainOneUtility() in
> turn calls ExplainExecuteQuery for execute statements and handles
> everything else internally.  The placement of the hook seems pretty
> dubious to me (does anyone actually use it?), and the whole structure
> seems like it could probably be flattened a bit.

IIRC, a fair amount of the messiness has to do with handling prepared
statements.  Maybe refactoring the division of labor between prepare.c
and explain.c would help.  Whether it's worth the trouble is
questionable though.  The immediate issue seems to be insufficient
thought about how to manage the initialization conditions for the
various formatters, and I don't think that any flattening or refactoring
of the rest of the logic would have made any difference there.

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to