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 the 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 t.a from t join t as t2 on t.a = t2.b -> projection ("t"."a"::integer -> "a") ... 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 ```
Showing
- sbroad-cartridge/test_app/test/integration/explain_test.lua 12 additions, 0 deletionssbroad-cartridge/test_app/test/integration/explain_test.lua
- sbroad-cartridge/test_app/test/integration/left_outer_join_test.lua 5 additions, 0 deletions...tridge/test_app/test/integration/left_outer_join_test.lua
- sbroad-core/src/executor.rs 8 additions, 3 deletionssbroad-core/src/executor.rs
- sbroad-core/src/executor/tests/frontend.rs 7 additions, 3 deletionssbroad-core/src/executor/tests/frontend.rs
- sbroad-core/src/ir/explain.rs 82 additions, 2 deletionssbroad-core/src/ir/explain.rs
- sbroad-core/src/ir/explain/execution_info.rs 200 additions, 0 deletionssbroad-core/src/ir/explain/execution_info.rs
- sbroad-core/src/ir/explain/tests.rs 24 additions, 1 deletionsbroad-core/src/ir/explain/tests.rs
- sbroad-core/src/ir/explain/tests/query_explain.rs 302 additions, 0 deletionssbroad-core/src/ir/explain/tests/query_explain.rs
- sbroad-core/src/ir/node/relational.rs 50 additions, 0 deletionssbroad-core/src/ir/node/relational.rs
Loading
Please register or sign in to comment