Skip to content

perf(sql): use unordered maps only in single-column case#6481

Merged
bluestreak01 merged 4 commits intomasterfrom
puzpuzpuz_revisit_maps_mk2
Dec 3, 2025
Merged

perf(sql): use unordered maps only in single-column case#6481
bluestreak01 merged 4 commits intomasterfrom
puzpuzpuz_revisit_maps_mk2

Conversation

@puzpuzpuz
Copy link
Copy Markdown
Contributor

@puzpuzpuz puzpuzpuz commented Dec 1, 2025

Tiny column sinks in Unordered4Map and Unordered8Map led to false sharing when jemalloc is in use. So, these maps are now used only in the single column case and support a few 4 byte/8 byte columns.

Also, removes Unordered2Map since it shows no improvement on top of other maps, so it's simply not worth it having it in the code base.

Benchmarks

This patch significantly reduces execution times of Q15 and Q35 (but not only) in ClickBench when jemalloc is in use. The below results are measured on c6a.metal instance:

Screenshot from 2025-12-03 19-20-04 Screenshot from 2025-12-03 19-20-14

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

coderabbitai bot commented Dec 1, 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 (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch puzpuzpuz_revisit_maps_mk2

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 force-pushed the puzpuzpuz_revisit_maps_mk2 branch from ab733ec to 1be4839 Compare December 3, 2025 17:16
@puzpuzpuz puzpuzpuz marked this pull request as ready for review December 3, 2025 17:16
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 79 / 92 (85.87%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/map/Unordered8Map.java 29 37 78.38%
🔵 io/questdb/cairo/map/Unordered4Map.java 30 35 85.71%
🔵 io/questdb/cairo/map/Unordered8MapRecord.java 5 5 100.00%
🔵 io/questdb/cairo/map/Unordered4MapRecord.java 5 5 100.00%
🔵 io/questdb/cairo/map/MapFactory.java 10 10 100.00%

@bluestreak01 bluestreak01 merged commit 1583b84 into master Dec 3, 2025
43 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_revisit_maps_mk2 branch December 3, 2025 21:10
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.

3 participants