Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds
EXPLAINto the session. The planner makes a tree of plan nodes for a query, and the session shows the tree in the text, JSON, XML and YAML forms, as PostgreSQL 19 does. In the scripts against the PostgreSQL 19 oracle, 193 of 222 statements give the same output.Changes
rupg-planhas the plan nodes and the output ofEXPLAINin each form.rupg-optmakes the plan of a query: the scans, the joins, the aggregates, the windows, the set operations, the sorts,LIMIT, the subplans and the init plans, and the node of a statement that writes a table. It has the costs of PostgreSQL with no statistics.rupg-funcwrites the expressions of the plan with the names of the relations thatEXPLAINchooses, and the names of the subplans and of the windows.EXPLAINand their errors, and gives one row for each line of the text form, or one row for the other forms.select_active_windowssorts them, and a window with no name takes the namew1,w2and so on in that order.DISTINCT ONsorts on all the items ofORDER BY.VALUESwith one row that is the only relation becomes aResult.SELECT.EXISTSgives no output. The scan of anUPDATEgives only the new values of the columns ofSETandctid, and the scan of aDELETEgives onlyctid.unnestof a constant array are the number of its elements.Known differences
Inner Uniqueis always false.IN,EXISTS,NOT EXISTSandANYinto joins, and it does not push conditions into subqueries or intoUNION ALL.exists_to_any, noMinMaxAggregate, and no order of the joins of three or more relations from equivalence classes.VERBOSEdoes not show the output ofRETURNINGon the node that writes the table.ANALYZE,GENERIC_PLAN,MEMORYandEXPLAIN EXECUTEgive an error that they are not supported yet.EXPLAINin the extended protocol is not supported yet.Tests
connection/explain.testandconnection/explain_keys.testare the output of PostgreSQL 19 for the same scripts in a new database.