mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Compares elapsed time with `optimize_trivial_group_by_limit_query = 1` vs `0` on `SELECT number FROM numbers_mt(100000000) GROUP BY number LIMIT 5` to demonstrate the end-user win on the target query shape. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
10 lines
637 B
XML
10 lines
637 B
XML
<test>
|
|
<!-- For `SELECT k FROM t GROUP BY k LIMIT n` aggregation should stop once
|
|
`n` distinct keys are produced rather than aggregating the entire input.
|
|
Compare the optimized path vs the disabled setting on a large input
|
|
with many distinct keys but a small `LIMIT`. -->
|
|
|
|
<query tag="optimized">SELECT number FROM numbers_mt(100000000) GROUP BY number LIMIT 5 FORMAT Null SETTINGS optimize_trivial_group_by_limit_query = 1</query>
|
|
<query tag="baseline">SELECT number FROM numbers_mt(100000000) GROUP BY number LIMIT 5 FORMAT Null SETTINGS optimize_trivial_group_by_limit_query = 0</query>
|
|
</test>
|