Skip to content

perf(sql): rewrite trivial expressions over same column in GROUP BY queries#6043

Merged
bluestreak01 merged 31 commits intomasterfrom
nw_rewrite_trivial_expr
Sep 26, 2025
Merged

perf(sql): rewrite trivial expressions over same column in GROUP BY queries#6043
bluestreak01 merged 31 commits intomasterfrom
nw_rewrite_trivial_expr

Conversation

@puzpuzpuz
Copy link
Copy Markdown
Contributor

@puzpuzpuz puzpuzpuz commented Aug 9, 2025

Closes #4141

Continuation of #4508

Also includes the following:

  • Adds integer value support to CSV import of IPv4 columns.
  • Adds yyyy-mm-dd date format to default text loader formats.

Benchmarks

With these changes we get an improvement in Q35 from ClickBench. The hot execution times on my 12c/24t Linux box are the following:

  • master - 724ms
  • patch - 388ms

@puzpuzpuz puzpuzpuz self-assigned this Aug 9, 2025
@puzpuzpuz puzpuzpuz added SQL Issues or changes relating to SQL execution Performance Performance improvements labels Aug 9, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 9, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nw_rewrite_trivial_expr

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@puzpuzpuz puzpuzpuz changed the title Nw rewrite trivial expr perf(sql): rewrite trivial expressions over same column in GROUP BY queries Aug 9, 2025
@puzpuzpuz puzpuzpuz force-pushed the nw_rewrite_trivial_expr branch from 5cf2dd7 to 332a5eb Compare August 19, 2025 17:26
@puzpuzpuz puzpuzpuz marked this pull request as ready for review August 25, 2025 13:36
@puzpuzpuz puzpuzpuz force-pushed the nw_rewrite_trivial_expr branch from feb2fbf to 5042162 Compare August 25, 2025 15:46
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 127 / 128 (99.22%)

file detail

path covered line new line coverage
🔵 io/questdb/cutlass/text/types/IPv4Adapter.java 12 13 92.31%
🔵 io/questdb/griffin/engine/functions/math/IPv4MinusIPv4FunctionFactory.java 3 3 100.00%
🔵 io/questdb/std/str/Utf8s.java 11 11 100.00%
🔵 io/questdb/griffin/engine/functions/math/IPv4PlusIntFunctionFactory.java 2 2 100.00%
🔵 io/questdb/cutlass/text/CairoTextWriter.java 3 3 100.00%
🔵 io/questdb/std/LowerCaseCharSequenceIntHashMap.java 5 5 100.00%
🔵 io/questdb/griffin/engine/functions/math/IPv4MinusIntFunctionFactory.java 3 3 100.00%
🔵 io/questdb/griffin/engine/functions/math/IPv4MinusIPv4StrFunctionFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/math/IPv4StrMinusIPv4FunctionFactory.java 1 1 100.00%
🔵 io/questdb/griffin/SqlOptimiser.java 86 86 100.00%

@bluestreak01 bluestreak01 merged commit 6c5462e into master Sep 26, 2025
35 checks passed
@bluestreak01 bluestreak01 deleted the nw_rewrite_trivial_expr branch September 26, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance Performance improvements SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite GROUP BY queries with trivial expressions over the same column

3 participants