This issue tracks reimplementation of the work from stale PR #2075, which is being closed because it is too out of date to merge directly.
Original PR: https://github.com/clockworklabs/SpacetimeDB/pull/2075
Original author: @mamcx
Original branch: `mamcx/planner-printer`
Base branch: `master`
## Original PR summary
# Description of Changes
Incipient support for EXPLAIN with close plan output as in Postgres (but not yet conformant).
It has the extra capability of showing extra metadata about the schema & indexes, useful for testing & debugging.
Example:
-- Without metadata
Nested Loop
-> Index Scan using Index id 0 Unique(m.employee) on m
Index Cond: (m.employee = U64(1))
Output: m.employee, m.manager
-> Seq Scan on p
Output: p.id, p.name
Output: m.employee, m.manager, p.id, p.name
Planning Time: 541.5µs
-- With metadata
Query: SELECT m.* FROM m CROSS JOIN p WHERE m.employee = 1
Nested Loop
-> Index Scan using Index id 0 Unique(m.employee) on m
Index Cond: (m.employee = U64(1))
Output: m.employee, m.manager
-> Seq Scan on p:2
Output: p.id, p.name
Output: m.employee, m.manager, p.id, p.name
-------
Schema:
Label: m, TableId:1
Columns: employee, manager
Indexes: Index id 0 Unique(m.employee) on m, Index id 1 (m.manager) on m
Constraints: Constraint id 0: Unique(m.employee)
Label: p, TableId:3
Columns: id, name
Indexes: Index id 0 Unique(p.id) on p
Constraints: Constraint id 0: Unique(p.id)
Closes #2058.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
This issue tracks reimplementation of the work from stale PR #2075, which is being closed because it is too out of date to merge directly.
Incipient support for
EXPLAINwith close plan output as inPostgres(but not yet conformant).It has the extra capability of showing extra metadata about the schema & indexes, useful for testing & debugging.
Example:
Closes #2058.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing
Adding testing for both optimized or not variations of the plan
WILL NEED more test but is likely that we need to do another pr