explain refactoring v3
От | Robert Haas |
---|---|
Тема | explain refactoring v3 |
Дата | |
Msg-id | 603c8f070906051803nd4a9e3ekb72bcc379ad73f16@mail.gmail.com обсуждение исходный текст |
Список | pgsql-hackers |
Complete list of changes included in this patch: - Remove unnecesary parameters nkeys, keycols, and qlabel from show_sort_keys(), and completely unused parameter scanrelid from show_scan_qual(). - Include the StringInfo buffer used as a staging area for EXPLAIN output in the ExplainState object, rather than passing it around separately. - Refactor some duplicated logic out of show_scan_qual()/show_upper_qual() into new function show_qual(). - Refactor various bits of duplicated logic from explain_outNode() into new functions ExplainSubNodes(), ExplainMemberNodes(), and ExplainScanTarget(). - For consistency with the naming of other functions in this module and elsewhere, rename explain_outNode() to ExplainNode(). - Instead of having ExplainNode() indent all of the lines of its output except the first, and making it the caller's responsibility to properly indent the first line, make ExplainNode() indent the first line too. - Instead of having appendStringInfoSpaces() in ruleutils.c and separate logic to do the same thing in multiple places in explain.c, implement a single, efficient version of this logic in stringinfo.c. I'm planning to submit one or more follow-on patches to implement support for machine-readable EXPLAIN output, but it seems better to have this part as a separate patch, since I think all of these changes pretty much stand on their own, and this way it doesn't confuse the issue of what is going on in the main patch. One of the important parts of this tightening is that it substantially reduces the number of different places that write directly to the output buffer, which is good because essentially all of the remaining places will need to be changed to support XML/JSON output. ...Robert
Вложения
В списке pgsql-hackers по дате отправления: