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

perf(sql): statistics-based map pre-sizing for parallel group by #4517

Merged
merged 12 commits into from
May 17, 2024

Conversation

puzpuzpuz
Copy link
Contributor

@puzpuzpuz puzpuzpuz commented May 17, 2024

The statistics are cached in the factory, so the factory must be reused on subsequent query execution to benefit from pre-sizing. The maps are now also allocated lazily on worker threads.

ClickBench result improvement:
Screenshot from 2024-05-17 13-47-39

The next step is to introduce a global cache of record cursor factories instead of the per-connection select query cache that we currently have. Will be done in a separate PR.

@puzpuzpuz puzpuzpuz added SQL Issues or changes relating to SQL execution Performance Performance improvements labels May 17, 2024
@puzpuzpuz puzpuzpuz self-assigned this May 17, 2024
@puzpuzpuz puzpuzpuz marked this pull request as draft May 17, 2024 08:37
@puzpuzpuz puzpuzpuz marked this pull request as ready for review May 17, 2024 11:02
@bluestreak01 bluestreak01 self-requested a review May 17, 2024 15:08
@ideoma
Copy link
Collaborator

ideoma commented May 17, 2024

[PR Coverage check]

😍 pass : 176 / 176 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/map/Unordered4Map.java 1 1 100.00%
🔵 io/questdb/PropServerConfiguration.java 7 7 100.00%
🔵 io/questdb/cairo/map/Unordered8Map.java 1 1 100.00%
🔵 io/questdb/cairo/map/Unordered2Map.java 1 1 100.00%
🔵 io/questdb/griffin/engine/table/AsyncGroupByAtom.java 129 129 100.00%
🔵 io/questdb/cairo/DefaultCairoConfiguration.java 3 3 100.00%
🔵 io/questdb/cairo/map/Unordered16Map.java 1 1 100.00%
🔵 io/questdb/PropertyKey.java 3 3 100.00%
🔵 io/questdb/griffin/engine/table/AsyncGroupByRecordCursorFactory.java 20 20 100.00%
🔵 io/questdb/griffin/engine/table/AsyncGroupByRecordCursor.java 2 2 100.00%
🔵 io/questdb/cairo/map/OrderedMap.java 1 1 100.00%
🔵 io/questdb/cairo/CairoConfigurationWrapper.java 3 3 100.00%
🔵 io/questdb/cairo/map/UnorderedVarcharMap.java 1 1 100.00%
🔵 io/questdb/cairo/map/MapFactory.java 3 3 100.00%

@bluestreak01 bluestreak01 merged commit 67a2b48 into master May 17, 2024
24 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_group_by_map_stats branch May 17, 2024 17:52
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.

None yet

3 participants