Skip to content

perf(sql): speed up initial refresh of materialized views with high cardinality symbols#5906

Merged
bluestreak01 merged 4 commits intomasterfrom
puzpuzpuz_increase_symbol_writer_page_size
Jul 8, 2025
Merged

perf(sql): speed up initial refresh of materialized views with high cardinality symbols#5906
bluestreak01 merged 4 commits intomasterfrom
puzpuzpuz_increase_symbol_writer_page_size

Conversation

@puzpuzpuz
Copy link
Copy Markdown
Contributor

The append page size for symbol writer used to be set to 4KB (OS page size). Now it's set to 256KB.

Minimal reproducer:

create table x (id symbol capacity 100000000 nocache);
insert into x select x::string from long_sequence(100000000);

Before this patch the INSERT takes 30+ minutes (I wasn't patient enough to get the exact duration). With this patch, it's 20 seconds.

@puzpuzpuz puzpuzpuz self-assigned this Jul 8, 2025
@puzpuzpuz puzpuzpuz added SQL Issues or changes relating to SQL execution Performance Performance improvements labels Jul 8, 2025
jerrinot
jerrinot previously approved these changes Jul 8, 2025
@puzpuzpuz
Copy link
Copy Markdown
Contributor Author

@jerrinot thanks for the review!

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 8 / 9 (88.89%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/DefaultCairoConfiguration.java 3 4 75.00%
🔵 io/questdb/PropServerConfiguration.java 2 2 100.00%
🔵 io/questdb/cairo/SymbolMapWriter.java 1 1 100.00%
🔵 io/questdb/PropertyKey.java 1 1 100.00%
🔵 io/questdb/cairo/CairoConfigurationWrapper.java 1 1 100.00%

@bluestreak01 bluestreak01 merged commit ca6a824 into master Jul 8, 2025
34 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_increase_symbol_writer_page_size branch July 8, 2025 13:31
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.

4 participants