feat: show buckets estimation in explain
Summarize the changes
- feat: show buckets estimation in explain
- Add new line in explain reporting on which buckets query will be executed.
- For queries consisting of a single subtree we can say exactly on which buckets it will be executed, for queries with more subtrees (with motions), we provide an upper bound of total buckets used in the query. Upper bound is computed by merging buckets from leaf subtrees.
- In case for DML query with non-local motion we can't provide an upper bound, and print 'buckets: unknown'
Examples:
explain select a from t
->
projection ("t"."a"::integer -> "a")
scan "t"
execution options:
vdbe_max_steps = 45000
vtable_max_rows = 5000
buckets = [1-3000]
explain select id from _pico_table
->
projection ("_pico_table"."id"::unsigned -> "id")
scan "_pico_table"
execution options:
vdbe_max_steps = 45000
vtable_max_rows = 5000
buckets = any
explain insert into t values (1, 2)
->
insert "t" on conflict: fail
motion [policy: segment([ref("COLUMN_1")])]
values
value row (...)
execution options:
vdbe_max_steps = 45000
vtable_max_rows = 5000
buckets: unknown
- documentation: docs#377 (closed)
Ensure that
-
New code is covered by unit and integration tests. -
Related issues would be automatically closed with gitlab's closing pattern (Closes #issue_number
). -
Public modules are documented (check the rendered version withcargo doc --open
). -
(if PEST grammar has changed) EBNF grammar reflects these changes (check the result with railroad diagram generator.
Next steps
- Cherry-pick to: none
- Update sbroad submodule in picodata/picodata.
- (if EBNF grammar has changed) create a follow-up issue in picodata/docs.
Edited by Denis Smirnov