Skip to content
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

Use filtered_null_mask in CountGroupsAccumulator and PrimitiveGroupsAccumulator #11825

Closed
wants to merge 2 commits into from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 5, 2024

Which issue does this PR close?

Draft:

Rationale for this change

What changes are included in this PR?

Use the filtered_null_mask and set_nulls functions introduced in #11734 in

  • CountGroupsAccumulator
  • PrimitiveGroupsAccumulator

Are these changes tested?

functionally by CI

Perormance benchmarks show now change

++ critcmp main alamb/refactor_filtering
group                                       main
-----                                       ----
count convert state 30% nulls, no filter    1.00     29.1±0.03µs        ? ?/sec
count convert state 70% nulls, no filter    1.00     29.1±0.04µs        ? ?/sec
count convert state no nulls, filter        1.00     29.1±0.03µs        ? ?/sec
count convert state no nulls, no filter     1.00  1851.0±59.12ns        ? ?/sec
count convert state nulls, filter           1.00     29.8±3.21µs        ? ?/sec

Are there any user-facing changes?

No

@github-actions github-actions bot added functions and removed sqllogictest SQL Logic Tests (.slt) labels Aug 13, 2024
@alamb
Copy link
Contributor Author

alamb commented Aug 13, 2024

I ran some benchmarks which suggested this could be slowing queries down. I don't understand how that could be possible but I need to review it more carefully

@Rachelint
Copy link
Contributor

Hi, I am curious about the slower cases, I merge and run some benchmarks in my local , found some faster and no cases slower...

$ bash bench.sh compare main test-quick-filter
Comparing main and test-quick-filter
--------------------
Benchmark clickbench_1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃       main ┃ test-quick-filter ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0     │     0.73ms │            0.71ms │     no change │
│ QQuery 1     │    72.31ms │           71.48ms │     no change │
│ QQuery 2     │   174.84ms │          168.18ms │     no change │
│ QQuery 3     │   185.37ms │          186.78ms │     no change │
│ QQuery 4     │  1639.67ms │         1648.56ms │     no change │
│ QQuery 5     │  1590.07ms │         1598.66ms │     no change │
│ QQuery 6     │    60.32ms │           60.65ms │     no change │
│ QQuery 7     │    73.17ms │           73.85ms │     no change │
│ QQuery 8     │  2383.66ms │         2356.76ms │     no change │
│ QQuery 9     │  1978.38ms │         1953.21ms │     no change │
│ QQuery 10    │   578.05ms │          576.20ms │     no change │
│ QQuery 11    │   627.86ms │          637.43ms │     no change │
│ QQuery 12    │  1768.46ms │         1774.71ms │     no change │
│ QQuery 13    │  3423.99ms │         3383.07ms │     no change │
│ QQuery 14    │  2601.64ms │         2567.29ms │     no change │
│ QQuery 15    │  1834.62ms │         1814.21ms │     no change │
│ QQuery 16    │  4997.42ms │         4989.63ms │     no change │
│ QQuery 17    │  4877.33ms │         4933.17ms │     no change │
│ QQuery 18    │ 10282.15ms │        10473.54ms │     no change │
│ QQuery 19    │   152.76ms │          157.92ms │     no change │
│ QQuery 20    │  3375.83ms │         3347.01ms │     no change │
│ QQuery 21    │  3952.43ms │         3949.74ms │     no change │
│ QQuery 22    │  9192.80ms │         9144.10ms │     no change │
│ QQuery 23    │ 23504.90ms │        23605.83ms │     no change │
│ QQuery 24    │  1142.61ms │         1156.32ms │     no change │
│ QQuery 25    │  1033.47ms │         1018.34ms │     no change │
│ QQuery 26    │  1348.93ms │         1352.45ms │     no change │
│ QQuery 27    │  4839.62ms │         4806.33ms │     no change │
│ QQuery 28    │ 24268.67ms │        24279.39ms │     no change │
│ QQuery 29    │   928.99ms │          944.59ms │     no change │
│ QQuery 30    │  2078.71ms │         2091.26ms │     no change │
│ QQuery 31    │  2318.33ms │         2302.82ms │     no change │
│ QQuery 32    │  8414.80ms │         8531.02ms │     no change │
│ QQuery 33    │  9722.33ms │         9652.60ms │     no change │
│ QQuery 34    │  9647.72ms │         9660.34ms │     no change │
│ QQuery 35    │  3126.94ms │         3126.48ms │     no change │
│ QQuery 36    │   263.11ms │          266.64ms │     no change │
│ QQuery 37    │   168.94ms │          160.47ms │ +1.05x faster │
│ QQuery 38    │   156.60ms │          157.66ms │     no change │
│ QQuery 39    │   856.27ms │          822.14ms │     no change │
│ QQuery 40    │    66.63ms │           63.19ms │ +1.05x faster │
│ QQuery 41    │    59.91ms │           59.41ms │     no change │
│ QQuery 42    │    74.34ms │           70.33ms │ +1.06x faster │
└──────────────┴────────────┴───────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Benchmark Summary                ┃             ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Total Time (main)                │ 149845.75ms │
│ Total Time (test-quick-filter)   │ 149994.46ms │
│ Average Time (main)              │   3484.78ms │
│ Average Time (test-quick-filter) │   3488.24ms │
│ Queries Faster                   │           3 │
│ Queries Slower                   │           0 │
│ Queries with No Change           │          40 │
└──────────────────────────────────┴─────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃     main ┃ test-quick-filter ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 212.12ms │          206.97ms │     no change │
│ QQuery 2     │  56.70ms │           31.73ms │ +1.79x faster │
│ QQuery 3     │  83.48ms │           86.23ms │     no change │
│ QQuery 4     │  60.25ms │           59.16ms │     no change │
│ QQuery 5     │ 124.24ms │          122.70ms │     no change │
│ QQuery 6     │  13.19ms │           13.22ms │     no change │
│ QQuery 7     │ 254.12ms │          254.83ms │     no change │
│ QQuery 8     │  26.44ms │           26.76ms │     no change │
│ QQuery 9     │ 118.50ms │          118.72ms │     no change │
│ QQuery 10    │ 118.42ms │          119.48ms │     no change │
│ QQuery 11    │  61.76ms │           61.81ms │     no change │
│ QQuery 12    │  35.91ms │           36.83ms │     no change │
│ QQuery 13    │  80.13ms │           78.57ms │     no change │
│ QQuery 14    │  15.78ms │           15.80ms │     no change │
│ QQuery 15    │  25.39ms │           25.15ms │     no change │
│ QQuery 16    │  37.77ms │           36.74ms │     no change │
│ QQuery 17    │ 171.96ms │          171.32ms │     no change │
│ QQuery 18    │ 488.41ms │          490.60ms │     no change │
│ QQuery 19    │  38.33ms │           38.22ms │     no change │
│ QQuery 20    │  81.39ms │           80.92ms │     no change │
│ QQuery 21    │ 285.25ms │          283.90ms │     no change │
│ QQuery 22    │  19.12ms │           19.53ms │     no change │
└──────────────┴──────────┴───────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main)                │ 2408.66ms │
│ Total Time (test-quick-filter)   │ 2379.18ms │
│ Average Time (main)              │  109.48ms │
│ Average Time (test-quick-filter) │  108.14ms │
│ Queries Faster                   │         1 │
│ Queries Slower                   │         0 │
│ Queries with No Change           │        21 │
└──────────────────────────────────┴───────────┘
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃     main ┃ test-quick-filter ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │ 287.93ms │          292.32ms │     no change │
│ QQuery 2     │  48.35ms │           46.77ms │     no change │
│ QQuery 3     │ 114.12ms │          111.82ms │     no change │
│ QQuery 4     │  62.36ms │           59.06ms │ +1.06x faster │
│ QQuery 5     │ 193.38ms │          193.28ms │     no change │
│ QQuery 6     │  56.30ms │           56.94ms │     no change │
│ QQuery 7     │ 302.42ms │          305.13ms │     no change │
│ QQuery 8     │ 128.34ms │          123.74ms │     no change │
│ QQuery 9     │ 229.54ms │          229.28ms │     no change │
│ QQuery 10    │ 199.19ms │          201.12ms │     no change │
│ QQuery 11    │  32.95ms │           32.56ms │     no change │
│ QQuery 12    │  87.90ms │           84.09ms │     no change │
│ QQuery 13    │ 127.00ms │          128.93ms │     no change │
│ QQuery 14    │  79.24ms │           77.91ms │     no change │
│ QQuery 15    │ 109.18ms │          110.44ms │     no change │
│ QQuery 16    │  42.99ms │           41.24ms │     no change │
│ QQuery 17    │ 272.09ms │          276.05ms │     no change │
│ QQuery 18    │ 451.79ms │          449.93ms │     no change │
│ QQuery 19    │ 146.37ms │          139.91ms │     no change │
│ QQuery 20    │ 133.57ms │          133.79ms │     no change │
│ QQuery 21    │ 297.75ms │          299.75ms │     no change │
│ QQuery 22    │  28.28ms │           28.65ms │     no change │
└──────────────┴──────────┴───────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main)                │ 3431.02ms │
│ Total Time (test-quick-filter)   │ 3422.71ms │
│ Average Time (main)              │  155.96ms │
│ Average Time (test-quick-filter) │  155.58ms │
│ Queries Faster                   │         1 │
│ Queries Slower                   │         0 │
│ Queries with No Change           │        21 │
└──────────────────────────────────┴───────────┘

@alamb
Copy link
Contributor Author

alamb commented Sep 5, 2024

Hi, I am curious about the slower cases, I merge and run some benchmarks in my local , found some faster and no cases slower...

That is a good question -- I will try again

@alamb
Copy link
Contributor Author

alamb commented Sep 5, 2024

Here are some numebrs I got

--------------------
Benchmark clickbench_1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃  main_base ┃ alamb_refactor_filtering ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0     │     0.66ms │                   0.67ms │    no change │
│ QQuery 1     │    70.97ms │                  68.16ms │    no change │
│ QQuery 2     │   124.17ms │                 124.23ms │    no change │
│ QQuery 3     │   126.48ms │                 130.15ms │    no change │
│ QQuery 4     │   911.90ms │                 957.71ms │ 1.05x slower │
│ QQuery 5     │   994.55ms │                1089.04ms │ 1.10x slower │
│ QQuery 6     │    64.29ms │                  66.21ms │    no change │
│ QQuery 7     │    73.25ms │                  73.27ms │    no change │
│ QQuery 8     │  1288.59ms │                1364.24ms │ 1.06x slower │
│ QQuery 9     │  1277.36ms │                1336.09ms │    no change │
│ QQuery 10    │   442.71ms │                 455.57ms │    no change │
│ QQuery 11    │   477.07ms │                 484.26ms │    no change │
│ QQuery 12    │  1103.73ms │                1158.51ms │    no change │
│ QQuery 13    │  2002.74ms │                2180.76ms │ 1.09x slower │
│ QQuery 14    │  1471.05ms │                1559.51ms │ 1.06x slower │
│ QQuery 15    │  1036.81ms │                1093.86ms │ 1.06x slower │
│ QQuery 16    │  2706.80ms │                2848.09ms │ 1.05x slower │
│ QQuery 17    │  2676.80ms │                2757.30ms │    no change │
│ QQuery 18    │  5290.99ms │                5493.24ms │    no change │
│ QQuery 19    │   117.44ms │                 117.83ms │    no change │
│ QQuery 20    │  1596.13ms │                1656.20ms │    no change │
│ QQuery 21    │  1907.35ms │                1993.14ms │    no change │
│ QQuery 22    │  4279.04ms │                4798.28ms │ 1.12x slower │
│ QQuery 23    │ 10683.09ms │               11160.43ms │    no change │
│ QQuery 24    │   699.82ms │                 752.10ms │ 1.07x slower │
│ QQuery 25    │   622.51ms │                 688.27ms │ 1.11x slower │
│ QQuery 26    │   780.13ms │                 807.45ms │    no change │
│ QQuery 27    │  2444.56ms │                2454.07ms │    no change │
│ QQuery 28    │ 14851.89ms │               15092.24ms │    no change │
│ QQuery 29    │   565.82ms │                 566.23ms │    no change │
│ QQuery 30    │  1188.47ms │                1244.93ms │    no change │
│ QQuery 31    │  1269.38ms │                1320.96ms │    no change │
│ QQuery 32    │  4354.26ms │                4301.54ms │    no change │
│ QQuery 33    │  4758.16ms │                4817.66ms │    no change │
│ QQuery 34    │  4831.52ms │                4779.57ms │    no change │
│ QQuery 35    │  1693.58ms │                1681.64ms │    no change │
│ QQuery 36    │   320.00ms │                 322.63ms │    no change │
│ QQuery 37    │   209.72ms │                 222.36ms │ 1.06x slower │
│ QQuery 38    │   185.92ms │                 191.55ms │    no change │
│ QQuery 39    │   989.00ms │                 955.40ms │    no change │
│ QQuery 40    │    85.05ms │                  86.96ms │    no change │
│ QQuery 41    │    80.97ms │                  80.52ms │    no change │
│ QQuery 42    │    96.72ms │                  97.10ms │    no change │
└──────────────┴────────────┴──────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 80751.47ms │
│ Total Time (alamb_refactor_filtering)   │ 83429.92ms │
│ Average Time (main_base)                │  1877.94ms │
│ Average Time (alamb_refactor_filtering) │  1940.23ms │
│ Queries Faster                          │          0 │
│ Queries Slower                          │         11 │
│ Queries with No Change                  │         32 │
└─────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query        ┃ main_base ┃ alamb_refactor_filtering ┃    Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 0     │ 2538.43ms │                2582.72ms │ no change │
│ QQuery 1     │  798.38ms │                 806.03ms │ no change │
│ QQuery 2     │ 1600.08ms │                1589.07ms │ no change │
│ QQuery 3     │  659.24ms │                 632.97ms │ no change │
└──────────────┴───────────┴──────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 5596.12ms │
│ Total Time (alamb_refactor_filtering)   │ 5610.78ms │
│ Average Time (main_base)                │ 1399.03ms │
│ Average Time (alamb_refactor_filtering) │ 1402.70ms │
│ Queries Faster                          │         0 │
│ Queries Slower                          │         0 │
│ Queries with No Change                  │         4 │
└─────────────────────────────────────────┴───────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃  main_base ┃ alamb_refactor_filtering ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.28ms │                   2.21ms │    no change │
│ QQuery 1     │    38.34ms │                  36.87ms │    no change │
│ QQuery 2     │    91.15ms │                  95.18ms │    no change │
│ QQuery 3     │    96.68ms │                  96.54ms │    no change │
│ QQuery 4     │   880.07ms │                 896.35ms │    no change │
│ QQuery 5     │   906.51ms │                 946.06ms │    no change │
│ QQuery 6     │    33.76ms │                  34.59ms │    no change │
│ QQuery 7     │    39.20ms │                  40.38ms │    no change │
│ QQuery 8     │  1260.83ms │                1257.89ms │    no change │
│ QQuery 9     │  1239.04ms │                1265.09ms │    no change │
│ QQuery 10    │   333.26ms │                 330.71ms │    no change │
│ QQuery 11    │   367.95ms │                 378.62ms │    no change │
│ QQuery 12    │   965.06ms │                 995.64ms │    no change │
│ QQuery 13    │  1750.86ms │                1760.32ms │    no change │
│ QQuery 14    │  1372.92ms │                1360.85ms │    no change │
│ QQuery 15    │   974.01ms │                 994.26ms │    no change │
│ QQuery 16    │  2612.89ms │                2610.61ms │    no change │
│ QQuery 17    │  2505.24ms │                2507.28ms │    no change │
│ QQuery 18    │  5175.54ms │                5324.69ms │    no change │
│ QQuery 19    │    90.68ms │                  91.88ms │    no change │
│ QQuery 20    │  1663.94ms │                1683.11ms │    no change │
│ QQuery 21    │  1859.67ms │                1885.70ms │    no change │
│ QQuery 22    │  4361.89ms │                4844.82ms │ 1.11x slower │
│ QQuery 23    │  9692.33ms │                9651.27ms │    no change │
│ QQuery 24    │   542.82ms │                 542.28ms │    no change │
│ QQuery 25    │   466.70ms │                 460.79ms │    no change │
│ QQuery 26    │   612.62ms │                 601.46ms │    no change │
│ QQuery 27    │  2344.57ms │                2380.80ms │    no change │
│ QQuery 28    │ 14284.08ms │               14300.53ms │    no change │
│ QQuery 29    │   527.25ms │                 519.61ms │    no change │
│ QQuery 30    │  1052.01ms │                1037.64ms │    no change │
│ QQuery 31    │  1122.46ms │                1100.79ms │    no change │
│ QQuery 32    │  4239.45ms │                4223.70ms │    no change │
│ QQuery 33    │  4761.53ms │                4751.63ms │    no change │
│ QQuery 34    │  4670.40ms │                4634.94ms │    no change │
│ QQuery 35    │  1595.53ms │                1593.64ms │    no change │
│ QQuery 36    │   262.97ms │                 254.52ms │    no change │
│ QQuery 37    │   118.58ms │                 120.38ms │    no change │
│ QQuery 38    │   136.44ms │                 142.32ms │    no change │
│ QQuery 39    │   890.79ms │                 872.51ms │    no change │
│ QQuery 40    │    54.89ms │                  55.66ms │    no change │
│ QQuery 41    │    47.34ms │                  45.32ms │    no change │
│ QQuery 42    │    66.19ms │                  64.18ms │    no change │
└──────────────┴────────────┴──────────────────────────┴──────────────┘
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃ main_base ┃ alamb_refactor_filtering ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │  252.62ms │                 231.12ms │ +1.09x faster │
│ QQuery 2     │  131.31ms │                 128.68ms │     no change │
│ QQuery 3     │  138.74ms │                 127.66ms │ +1.09x faster │
│ QQuery 4     │   92.29ms │                  90.74ms │     no change │
│ QQuery 5     │  180.88ms │                 174.53ms │     no change │
│ QQuery 6     │   60.26ms │                  59.93ms │     no change │
│ QQuery 7     │  223.37ms │                 215.78ms │     no change │
│ QQuery 8     │  165.38ms │                 164.22ms │     no change │
│ QQuery 9     │  259.49ms │                 253.23ms │     no change │
│ QQuery 10    │  244.94ms │                 225.08ms │ +1.09x faster │
│ QQuery 11    │  104.23ms │                 102.39ms │     no change │
│ QQuery 12    │  135.08ms │                 143.10ms │  1.06x slower │
│ QQuery 13    │  304.56ms │                 302.44ms │     no change │
│ QQuery 14    │   97.08ms │                  84.17ms │ +1.15x faster │
│ QQuery 15    │  128.14ms │                 114.49ms │ +1.12x faster │
│ QQuery 16    │   85.69ms │                  84.88ms │     no change │
│ QQuery 17    │  246.47ms │                 245.17ms │     no change │
│ QQuery 18    │  344.79ms │                 340.00ms │     no change │
│ QQuery 19    │  162.78ms │                 144.44ms │ +1.13x faster │
│ QQuery 20    │  145.63ms │                 136.03ms │ +1.07x faster │
│ QQuery 21    │  276.08ms │                 268.82ms │     no change │
│ QQuery 22    │   65.63ms │                  66.75ms │     no change │
└──────────────┴───────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 3845.43ms │
│ Total Time (alamb_refactor_filtering)   │ 3703.64ms │
│ Average Time (main_base)                │  174.79ms │
│ Average Time (alamb_refactor_filtering) │  168.35ms │
│ Queries Faster                          │         7 │
│ Queries Slower                          │         1 │
│ Queries with No Change                  │        14 │
└─────────────────────────────────────────┴───────────┘

@Rachelint
Copy link
Contributor

Here are some numebrs I got

--------------------
Benchmark clickbench_1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃  main_base ┃ alamb_refactor_filtering ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0     │     0.66ms │                   0.67ms │    no change │
│ QQuery 1     │    70.97ms │                  68.16ms │    no change │
│ QQuery 2     │   124.17ms │                 124.23ms │    no change │
│ QQuery 3     │   126.48ms │                 130.15ms │    no change │
│ QQuery 4     │   911.90ms │                 957.71ms │ 1.05x slower │
│ QQuery 5     │   994.55ms │                1089.04ms │ 1.10x slower │
│ QQuery 6     │    64.29ms │                  66.21ms │    no change │
│ QQuery 7     │    73.25ms │                  73.27ms │    no change │
│ QQuery 8     │  1288.59ms │                1364.24ms │ 1.06x slower │
│ QQuery 9     │  1277.36ms │                1336.09ms │    no change │
│ QQuery 10    │   442.71ms │                 455.57ms │    no change │
│ QQuery 11    │   477.07ms │                 484.26ms │    no change │
│ QQuery 12    │  1103.73ms │                1158.51ms │    no change │
│ QQuery 13    │  2002.74ms │                2180.76ms │ 1.09x slower │
│ QQuery 14    │  1471.05ms │                1559.51ms │ 1.06x slower │
│ QQuery 15    │  1036.81ms │                1093.86ms │ 1.06x slower │
│ QQuery 16    │  2706.80ms │                2848.09ms │ 1.05x slower │
│ QQuery 17    │  2676.80ms │                2757.30ms │    no change │
│ QQuery 18    │  5290.99ms │                5493.24ms │    no change │
│ QQuery 19    │   117.44ms │                 117.83ms │    no change │
│ QQuery 20    │  1596.13ms │                1656.20ms │    no change │
│ QQuery 21    │  1907.35ms │                1993.14ms │    no change │
│ QQuery 22    │  4279.04ms │                4798.28ms │ 1.12x slower │
│ QQuery 23    │ 10683.09ms │               11160.43ms │    no change │
│ QQuery 24    │   699.82ms │                 752.10ms │ 1.07x slower │
│ QQuery 25    │   622.51ms │                 688.27ms │ 1.11x slower │
│ QQuery 26    │   780.13ms │                 807.45ms │    no change │
│ QQuery 27    │  2444.56ms │                2454.07ms │    no change │
│ QQuery 28    │ 14851.89ms │               15092.24ms │    no change │
│ QQuery 29    │   565.82ms │                 566.23ms │    no change │
│ QQuery 30    │  1188.47ms │                1244.93ms │    no change │
│ QQuery 31    │  1269.38ms │                1320.96ms │    no change │
│ QQuery 32    │  4354.26ms │                4301.54ms │    no change │
│ QQuery 33    │  4758.16ms │                4817.66ms │    no change │
│ QQuery 34    │  4831.52ms │                4779.57ms │    no change │
│ QQuery 35    │  1693.58ms │                1681.64ms │    no change │
│ QQuery 36    │   320.00ms │                 322.63ms │    no change │
│ QQuery 37    │   209.72ms │                 222.36ms │ 1.06x slower │
│ QQuery 38    │   185.92ms │                 191.55ms │    no change │
│ QQuery 39    │   989.00ms │                 955.40ms │    no change │
│ QQuery 40    │    85.05ms │                  86.96ms │    no change │
│ QQuery 41    │    80.97ms │                  80.52ms │    no change │
│ QQuery 42    │    96.72ms │                  97.10ms │    no change │
└──────────────┴────────────┴──────────────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 80751.47ms │
│ Total Time (alamb_refactor_filtering)   │ 83429.92ms │
│ Average Time (main_base)                │  1877.94ms │
│ Average Time (alamb_refactor_filtering) │  1940.23ms │
│ Queries Faster                          │          0 │
│ Queries Slower                          │         11 │
│ Queries with No Change                  │         32 │
└─────────────────────────────────────────┴────────────┘
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query        ┃ main_base ┃ alamb_refactor_filtering ┃    Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 0     │ 2538.43ms │                2582.72ms │ no change │
│ QQuery 1     │  798.38ms │                 806.03ms │ no change │
│ QQuery 2     │ 1600.08ms │                1589.07ms │ no change │
│ QQuery 3     │  659.24ms │                 632.97ms │ no change │
└──────────────┴───────────┴──────────────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 5596.12ms │
│ Total Time (alamb_refactor_filtering)   │ 5610.78ms │
│ Average Time (main_base)                │ 1399.03ms │
│ Average Time (alamb_refactor_filtering) │ 1402.70ms │
│ Queries Faster                          │         0 │
│ Queries Slower                          │         0 │
│ Queries with No Change                  │         4 │
└─────────────────────────────────────────┴───────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query        ┃  main_base ┃ alamb_refactor_filtering ┃       Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0     │     2.28ms │                   2.21ms │    no change │
│ QQuery 1     │    38.34ms │                  36.87ms │    no change │
│ QQuery 2     │    91.15ms │                  95.18ms │    no change │
│ QQuery 3     │    96.68ms │                  96.54ms │    no change │
│ QQuery 4     │   880.07ms │                 896.35ms │    no change │
│ QQuery 5     │   906.51ms │                 946.06ms │    no change │
│ QQuery 6     │    33.76ms │                  34.59ms │    no change │
│ QQuery 7     │    39.20ms │                  40.38ms │    no change │
│ QQuery 8     │  1260.83ms │                1257.89ms │    no change │
│ QQuery 9     │  1239.04ms │                1265.09ms │    no change │
│ QQuery 10    │   333.26ms │                 330.71ms │    no change │
│ QQuery 11    │   367.95ms │                 378.62ms │    no change │
│ QQuery 12    │   965.06ms │                 995.64ms │    no change │
│ QQuery 13    │  1750.86ms │                1760.32ms │    no change │
│ QQuery 14    │  1372.92ms │                1360.85ms │    no change │
│ QQuery 15    │   974.01ms │                 994.26ms │    no change │
│ QQuery 16    │  2612.89ms │                2610.61ms │    no change │
│ QQuery 17    │  2505.24ms │                2507.28ms │    no change │
│ QQuery 18    │  5175.54ms │                5324.69ms │    no change │
│ QQuery 19    │    90.68ms │                  91.88ms │    no change │
│ QQuery 20    │  1663.94ms │                1683.11ms │    no change │
│ QQuery 21    │  1859.67ms │                1885.70ms │    no change │
│ QQuery 22    │  4361.89ms │                4844.82ms │ 1.11x slower │
│ QQuery 23    │  9692.33ms │                9651.27ms │    no change │
│ QQuery 24    │   542.82ms │                 542.28ms │    no change │
│ QQuery 25    │   466.70ms │                 460.79ms │    no change │
│ QQuery 26    │   612.62ms │                 601.46ms │    no change │
│ QQuery 27    │  2344.57ms │                2380.80ms │    no change │
│ QQuery 28    │ 14284.08ms │               14300.53ms │    no change │
│ QQuery 29    │   527.25ms │                 519.61ms │    no change │
│ QQuery 30    │  1052.01ms │                1037.64ms │    no change │
│ QQuery 31    │  1122.46ms │                1100.79ms │    no change │
│ QQuery 32    │  4239.45ms │                4223.70ms │    no change │
│ QQuery 33    │  4761.53ms │                4751.63ms │    no change │
│ QQuery 34    │  4670.40ms │                4634.94ms │    no change │
│ QQuery 35    │  1595.53ms │                1593.64ms │    no change │
│ QQuery 36    │   262.97ms │                 254.52ms │    no change │
│ QQuery 37    │   118.58ms │                 120.38ms │    no change │
│ QQuery 38    │   136.44ms │                 142.32ms │    no change │
│ QQuery 39    │   890.79ms │                 872.51ms │    no change │
│ QQuery 40    │    54.89ms │                  55.66ms │    no change │
│ QQuery 41    │    47.34ms │                  45.32ms │    no change │
│ QQuery 42    │    66.19ms │                  64.18ms │    no change │
└──────────────┴────────────┴──────────────────────────┴──────────────┘
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query        ┃ main_base ┃ alamb_refactor_filtering ┃        Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1     │  252.62ms │                 231.12ms │ +1.09x faster │
│ QQuery 2     │  131.31ms │                 128.68ms │     no change │
│ QQuery 3     │  138.74ms │                 127.66ms │ +1.09x faster │
│ QQuery 4     │   92.29ms │                  90.74ms │     no change │
│ QQuery 5     │  180.88ms │                 174.53ms │     no change │
│ QQuery 6     │   60.26ms │                  59.93ms │     no change │
│ QQuery 7     │  223.37ms │                 215.78ms │     no change │
│ QQuery 8     │  165.38ms │                 164.22ms │     no change │
│ QQuery 9     │  259.49ms │                 253.23ms │     no change │
│ QQuery 10    │  244.94ms │                 225.08ms │ +1.09x faster │
│ QQuery 11    │  104.23ms │                 102.39ms │     no change │
│ QQuery 12    │  135.08ms │                 143.10ms │  1.06x slower │
│ QQuery 13    │  304.56ms │                 302.44ms │     no change │
│ QQuery 14    │   97.08ms │                  84.17ms │ +1.15x faster │
│ QQuery 15    │  128.14ms │                 114.49ms │ +1.12x faster │
│ QQuery 16    │   85.69ms │                  84.88ms │     no change │
│ QQuery 17    │  246.47ms │                 245.17ms │     no change │
│ QQuery 18    │  344.79ms │                 340.00ms │     no change │
│ QQuery 19    │  162.78ms │                 144.44ms │ +1.13x faster │
│ QQuery 20    │  145.63ms │                 136.03ms │ +1.07x faster │
│ QQuery 21    │  276.08ms │                 268.82ms │     no change │
│ QQuery 22    │   65.63ms │                  66.75ms │     no change │
└──────────────┴───────────┴──────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                       ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (main_base)                  │ 3845.43ms │
│ Total Time (alamb_refactor_filtering)   │ 3703.64ms │
│ Average Time (main_base)                │  174.79ms │
│ Average Time (alamb_refactor_filtering) │  168.35ms │
│ Queries Faster                          │         7 │
│ Queries Slower                          │         1 │
│ Queries with No Change                  │        14 │
└─────────────────────────────────────────┴───────────┘

Really strange... I will check it again too

Copy link

github-actions bot commented Nov 7, 2024

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale PR has not had any activity for some time label Nov 7, 2024
@alamb alamb closed this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions Stale PR has not had any activity for some time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants