See pull request for branch improved-explain, please review @bryanthompson .
Implemented first version of improved EXPLAIN, as documented at https://docs.google.com/spreadsheets/d/1EcpsimlsObw5fe3h7oCRF79EtG9TAmdaCfZ7KotvbCQ/edit#gid=1811786356. Currently, the explain output is rendered as part of the explain in a dedicated section, labelled "ExplainHints". The output is in the form of a simple table for now and might be further improved, in case you feel this is required it is something maginfo could take over as part of the explain page refactoring under discussion.
Currently, explain hints are implemented for the following patterns (as sketched in the Google Doc above):
- Variables that are not in scope due to bottom-up semantics
- Unsatisfiable MINUS expressions
- Possible problems with join group reordering
The implementation contains a set of test cases covering these scenarios above. See the associated test cases for sample queries that cause such hints to be attached.