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

feat: introduce block meta cache #17360

Merged

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Jan 23, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

We previously had a block meta cache, but it was rather coarse-grained. Blockmetas were cached at the segment level, which worked reasonably for scenarios like general table pruning. However, for operations like replace into, we needed something more fine-grained.

So, in this PR:

  • Rename the old segment-level block meta cache to SegmentBlockMetasCache.
    Each item in this cache is an array of BlockMeta objects, representing all the block metas for a specific segment.

  • Introduce a new BlockMetaCache.
    Each item in this cache is a single BlockMeta.

  • Adjust system.caches and system$set_cache_capacity to fit these changes.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Jan 23, 2025
@dantengsky dantengsky force-pushed the feat/individual-block-meta-cache branch from a5351ac to 86196dc Compare January 23, 2025 12:45
@dantengsky dantengsky force-pushed the feat/individual-block-meta-cache branch from 20a38c7 to 9bfdd90 Compare January 23, 2025 14:00
@dantengsky dantengsky marked this pull request as ready for review January 24, 2025 03:25
@dantengsky dantengsky added this pull request to the merge queue Jan 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 24, 2025
@dantengsky dantengsky added this pull request to the merge queue Jan 24, 2025
Merged via the queue into databendlabs:main with commit 1e3f260 Jan 24, 2025
73 checks passed
@dantengsky dantengsky deleted the feat/individual-block-meta-cache branch January 24, 2025 04:48
dantengsky added a commit to dantengsky/fuse-query that referenced this pull request Feb 5, 2025
* feat: introduce BlockMetaCache

* tweak sys tbl `system.cache` and configs

* cargo fmt

* update ut gloden file

* fix: set cache cap of `memory_cache_block_meta`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants