-
Notifications
You must be signed in to change notification settings - Fork 2.2k
bench: add predicate_eval SQL micro-benchmark suite for conjunctive filter evaluation #22704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adriangb
wants to merge
2
commits into
apache:main
Choose a base branch
from
pydantic:predicate-eval-benchmarks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cardinality/q30.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cardinality | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cardinality | ||
| QPAD=30 | ||
| DATASET=ints | ||
| NAME=cardinality_q30_k2 | ||
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cardinality/q31.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cardinality | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cardinality | ||
| QPAD=31 | ||
| DATASET=ints | ||
| NAME=cardinality_q31_k4 |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cardinality/q32.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cardinality | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cardinality | ||
| QPAD=32 | ||
| DATASET=ints | ||
| NAME=cardinality_q32_k8 |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cardinality/q33.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cardinality | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cardinality | ||
| QPAD=33 | ||
| DATASET=ints | ||
| NAME=cardinality_q33_k16 |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/correlation/q70.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup correlation | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=correlation | ||
| QPAD=70 | ||
| DATASET=corr | ||
| NAME=correlation_q70_independent |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/correlation/q71.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup correlation | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=correlation | ||
| QPAD=71 | ||
| DATASET=corr | ||
| NAME=correlation_q71_positive |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/correlation/q72.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup correlation | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=correlation | ||
| QPAD=72 | ||
| DATASET=corr | ||
| NAME=correlation_q72_anti |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cost/q10.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cost | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cost | ||
| QPAD=10 | ||
| DATASET=mixed | ||
| NAME=cost_q10_expensive_first |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/cost/q11.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup cost | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=cost | ||
| QPAD=11 | ||
| DATASET=mixed | ||
| NAME=cost_q11_cheap_first |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/costsel/q01.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup costsel | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=costsel | ||
| QPAD=01 | ||
| DATASET=markers | ||
| NAME=costsel_q01_regexp_selective_last |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/costsel/q02.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup costsel | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=costsel | ||
| QPAD=02 | ||
| DATASET=markers | ||
| NAME=costsel_q02_regexp_selective_first |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/costsel/q03.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup costsel | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=costsel | ||
| QPAD=03 | ||
| DATASET=mixed | ||
| NAME=costsel_q03_cheap_unselective_then_expensive_selective |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/drift/q80.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup drift | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=drift | ||
| QPAD=80 | ||
| DATASET=drift | ||
| NAME=drift_q80_a_then_b |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/drift/q81.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup drift | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=drift | ||
| QPAD=81 | ||
| DATASET=drift | ||
| NAME=drift_q81_b_then_a |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/neutral/q60.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup neutral | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=neutral | ||
| QPAD=60 | ||
| DATASET=ints | ||
| NAME=neutral_q60_cheap_uniform |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/neutral/q61.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup neutral | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=neutral | ||
| QPAD=61 | ||
| DATASET=markers | ||
| NAME=neutral_q61_expensive_uniform |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/nulls/q90.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup nulls | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=nulls | ||
| QPAD=90 | ||
| DATASET=ints | ||
| NAME=nulls_q90_no_nulls_control |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/nulls/q91.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup nulls | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=nulls | ||
| QPAD=91 | ||
| DATASET=nulls | ||
| NAME=nulls_q91_half_null |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/scale/q50.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup scale | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=scale | ||
| QPAD=50 | ||
| DATASET=mixed | ||
| PRED_ROWS=5000 | ||
| NAME=scale_q50_5k |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/scale/q51.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup scale | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=scale | ||
| QPAD=51 | ||
| DATASET=mixed | ||
| PRED_ROWS=100000 | ||
| NAME=scale_q51_100k |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/scale/q52.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup scale | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=scale | ||
| QPAD=52 | ||
| DATASET=mixed | ||
| PRED_ROWS=5000000 | ||
| NAME=scale_q52_5m |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/scale/q53.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup scale | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=scale | ||
| QPAD=53 | ||
| DATASET=mixed | ||
| PRED_ROWS=50000000 | ||
| NAME=scale_q53_50m |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/selectivity/q20.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup selectivity | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=selectivity | ||
| QPAD=20 | ||
| DATASET=ints | ||
| NAME=selectivity_q20_unselective_first |
7 changes: 7 additions & 0 deletions
7
benchmarks/sql_benchmarks/predicate_eval/benchmarks/selectivity/q21.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| subgroup selectivity | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=selectivity | ||
| QPAD=21 | ||
| DATASET=ints | ||
| NAME=selectivity_q21_selective_first |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/width/q40.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup width | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=width | ||
| QPAD=40 | ||
| DATASET=markers | ||
| PRED_FILL=2 | ||
| NAME=width_q40_narrow |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/width/q41.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup width | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=width | ||
| QPAD=41 | ||
| DATASET=markers | ||
| PRED_FILL=30 | ||
| NAME=width_q41_wide |
8 changes: 8 additions & 0 deletions
8
benchmarks/sql_benchmarks/predicate_eval/benchmarks/width/q42.benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| subgroup width | ||
|
|
||
| template sql_benchmarks/predicate_eval/predicate_eval.benchmark.template | ||
| SUBGROUP=width | ||
| QPAD=42 | ||
| DATASET=markers | ||
| PRED_FILL=170 | ||
| NAME=width_q42_xwide |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DROP TABLE IF EXISTS t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| -- Correlation dataset: a base column plus derived columns that control the | ||
| -- *conditional* selectivity of one predicate given another (its selectivity | ||
| -- among the rows that already passed the other). | ||
| -- | ||
| -- x uniform [0,100) | ||
| -- x_pos = x (perfectly positively correlated: `x<k AND x_pos<k` | ||
| -- passes ~k%, not the ~k%^2 an independence assumption | ||
| -- predicts) | ||
| -- x_anti = 99 - x (anti-correlated: `x<k AND x_anti<k` is empty for k<=50) | ||
| -- ind independent control column, uniform [0,100) | ||
| -- | ||
| -- PRED_ROWS sizes the table. | ||
| CREATE TABLE t AS | ||
| SELECT | ||
| (value * 7) % 100 AS x, | ||
| (value * 7) % 100 AS x_pos, | ||
| 99 - ((value * 7) % 100) AS x_anti, | ||
| (value * 13) % 100 AS ind | ||
| FROM generate_series(1, ${PRED_ROWS:-1000000}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| -- Drift dataset: two predicates whose *relative* selectivity flips partway | ||
| -- through the scan, so whole-table selectivity differs from per-batch | ||
| -- selectivity. Rows are emitted in `seq` order, so batches observe the drift in | ||
| -- order. | ||
| -- | ||
| -- a_sel = 0 is selective (~0.1%) in the first 10% of rows, unselective | ||
| -- (~50%) afterwards. | ||
| -- b_sel = 0 is the mirror: unselective early, selective late. | ||
| -- | ||
| -- PRED_ROWS sizes the table. | ||
| CREATE TABLE t AS | ||
| SELECT | ||
| value AS seq, | ||
| CASE WHEN value < ${PRED_ROWS:-1000000} / 10 THEN value % 1000 ELSE value % 2 END AS a_sel, | ||
| CASE WHEN value < ${PRED_ROWS:-1000000} / 10 THEN value % 2 ELSE value % 1000 END AS b_sel | ||
| FROM generate_series(1, ${PRED_ROWS:-1000000}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| -- Sixteen independent integer columns, each uniform on [0,100). The predicate | ||
| -- `cN < k` therefore has selectivity ~k%. All columns are equally cheap to | ||
| -- evaluate, so only selectivity (not cost) distinguishes orderings here. The | ||
| -- multipliers are all coprime to 100, which keeps the residues uniform and the | ||
| -- columns mutually decorrelated. PRED_ROWS sizes the table. | ||
| CREATE TABLE t AS | ||
| SELECT | ||
| (value * 1) % 100 AS c0, | ||
| (value * 3) % 100 AS c1, | ||
| (value * 7) % 100 AS c2, | ||
| (value * 9) % 100 AS c3, | ||
| (value * 11) % 100 AS c4, | ||
| (value * 13) % 100 AS c5, | ||
| (value * 17) % 100 AS c6, | ||
| (value * 19) % 100 AS c7, | ||
| (value * 21) % 100 AS c8, | ||
| (value * 23) % 100 AS c9, | ||
| (value * 27) % 100 AS c10, | ||
| (value * 29) % 100 AS c11, | ||
| (value * 31) % 100 AS c12, | ||
| (value * 33) % 100 AS c13, | ||
| (value * 37) % 100 AS c14, | ||
| (value * 39) % 100 AS c15 | ||
| FROM generate_series(1, ${PRED_ROWS:-1000000}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| -- Wide-string dataset: five markers embedded in `PRED_FILL`-wide filler so that a | ||
| -- non-matching `regexp_like` must scan the whole value (every string predicate | ||
| -- is "expensive"). Selectivities are coprime so the predicates are independent: | ||
| -- | ||
| -- 'aaa' present in ~90% of rows (value % 10 <> 0) | ||
| -- 'bbb' present in ~86% of rows (value % 7 <> 0) | ||
| -- 'ccc' present in ~80% of rows (value % 5 <> 0) | ||
| -- 'ddd' present in ~75% of rows (value % 4 <> 0) | ||
| -- 'rare' present in ~0.1% of rows (value % 1009 = 5) <- the selective one | ||
| -- | ||
| -- PRED_FILL sets the filler width per marker (the string-column width knob: ~6*PRED_FILL | ||
| -- chars per row), and PRED_ROWS sizes the table. | ||
| CREATE TABLE t AS | ||
| SELECT | ||
| repeat('q', ${PRED_FILL:-30}) | ||
| || CASE WHEN value % 10 <> 0 THEN 'aaa' ELSE 'zzz' END | ||
| || repeat('q', ${PRED_FILL:-30}) | ||
| || CASE WHEN value % 7 <> 0 THEN 'bbb' ELSE 'zzz' END | ||
| || repeat('q', ${PRED_FILL:-30}) | ||
| || CASE WHEN value % 5 <> 0 THEN 'ccc' ELSE 'zzz' END | ||
| || repeat('q', ${PRED_FILL:-30}) | ||
| || CASE WHEN value % 4 <> 0 THEN 'ddd' ELSE 'zzz' END | ||
| || repeat('q', ${PRED_FILL:-30}) | ||
| || CASE WHEN value % 1009 = 5 THEN 'rare' ELSE 'zzzz' END | ||
| || repeat('q', ${PRED_FILL:-30}) AS s | ||
| FROM generate_series(1, ${PRED_ROWS:-1000000}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Omega359 -- it is cool to see the new benchmark runners in action