Rationalizing EXPLAIN VERBOSE output
От | Tom Lane |
---|---|
Тема | Rationalizing EXPLAIN VERBOSE output |
Дата | |
Msg-id | 9125.1015700961@sss.pgh.pa.us обсуждение исходный текст |
Ответы |
Re: Rationalizing EXPLAIN VERBOSE output
Re: Rationalizing EXPLAIN VERBOSE output |
Список | pgsql-hackers |
Now that Bruce has done some work on rationalizing elog() output, seems like we ought to take another look at EXPLAIN VERBOSE. Currently, that command does this: 1. A non-pretty-printed plan dump (nodeToString output) is sent to elog(INFO). Formerly that always output to both postmaster log and client, but now it'll typically go only to the client. 2. The short-form output (same as non-VERBOSE EXPLAIN) is sent to elog(INFO). See above. 3. The pretty-printed plan dump is sent to postmaster stdout. Now postmaster stdout is just about the least good destination we could possibly use. It may well end up in the bit bucket (if someone is only saving stderr output, and/or is using syslog logging instead of stderr). In any case it's not necessarily an easy place for the client to get at. Also, I find the non-pretty-printed dump format damn near unreadable, although I have seen comments suggesting that there are some people who actually like it. I don't see the point of giving it pride of place on the client's terminal. What I would suggest is that EXPLAIN VERBOSE ought to emit either non-pretty-print or pretty-print dump format, not both (probably control this with debug_pretty_print or another newly-invented GUC parameter; IMHO the factory default should be pretty-printing). Furthermore, the output should go to elog(INFO) in either case. This will take some work to make the prettyprinter capable of that, but it's not a big job. (A side effect of this is that pprint dumps logged by the debug_print_plan and so forth options could go through elog as well, which they don't now.) A disadvantage of elog(INFO) output for pretty-printed plans is that AFAIK psql doesn't currently have any way of capturing NOTICE output into a file. I find it much better to look at pretty-printed dumps in Emacs than on a terminal window, mainly because Emac's M-C-f and M-C-b commands understand the nesting structure so it's easy to move around in the dump with them. How hard would it be to get psql to send notice output into a \g file? Comments? In particular, should EXPLAIN use the existing debug_pretty_print GUC variable, or have its own? regards, tom lane
В списке pgsql-hackers по дате отправления: