feat: add --cache-index-filter-blocks flag#201
Merged
philippem merged 1 commit intoBlockstream:new-indexfrom Mar 31, 2026
Merged
feat: add --cache-index-filter-blocks flag#201philippem merged 1 commit intoBlockstream:new-indexfrom
philippem merged 1 commit intoBlockstream:new-indexfrom
Conversation
By default, index and filter blocks live on the heap where they may never be evicted (~18 MB per SST file). Pass --cache-index-filter-blocks to store them in the block cache instead, bounding memory at the cost of possible eviction under cache pressure.
c0a7f92 to
3ff1592
Compare
philippem
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cache_index_and_filter_blocksopt-in via--cache-index-filter-blocksCLI flagBackground
With bloom filters enabled, each SST file carries ~18 MB of index + filter blocks in memory. On a mainnet node with ~1900 SST files, that's ~35 GB of table reader memory.
When these blocks live in the block cache (
cache_index_and_filter_blocks=true), they compete with data blocks for cache space and can be evicted under pressure.The flag exists for memory-constrained deployments where bounding memory is more important than peak read performance.
Test plan
cargo check/cargo buildwith default featurescargo build --features liquid--cache-index-filter-blocks: index/filter blocks bounded by--db-block-cache-mb