You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge 'EXPLAIN QUERY PLAN: fix incorrect join order, add missing annotations, convert some snapshot tests to EQP-only' from Jussi Saurio
## EXPLAIN QUERY PLAN didn't show correct join order
- EXPLAIN QUERY PLAN was showing original join order, not the actual
join order after optimizer pass. Highly annoying and clankers get mega
confused by it too.
- Fixing the above issue revealed that left join ordering fuzz test
(based on EQP output) was not accounting for LEFT->INNER optimizations,
so fix that by only asserting on LEFT JOINs that survived the optimizer
pass
## EXPLAIN QUERY PLAN was missing stuff that SQLite has
- EXPLAIN QUERY PLAN was missing annotations for GROUP BY, DISTINCT,
subqueries + it had an incorrect `USE TEMP B-TREE FOR ORDER BY`
annotation because we never use temp b-tree for sorting, so instead
print `USE SORTER FOR ORDER BY`. Also add turso-custom prints like `USE
HASH TABLE FOR count(DISTINCT)` (sqlite doesn't have hash table)
## Add new snapshot format that only prints EQP instead of full
bytecode, in cases where we don't much care about the full bytecode
- Add new `snapshot-eqp` snapshot test format that just prints the EQP,
not the bytecode
- Convert a bunch of snapshots to use `snapshot-eqp` (for example, most
TPC-H tests; in many of them we just care about the join order and maybe
order by elimination)
- Note: the massive diff is due to the above - main change commits are
smaller
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes#5511
0 commit comments