Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/query/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3316,6 +3316,14 @@ pub struct CacheConfig {
)]
pub inverted_index_meta_count: u64,

/// Max bytes of cached inverted index metadata on disk. Set it to 0 to disable it.
#[clap(
long = "disk-cache-inverted-index-meta-size",
value_name = "VALUE",
default_value = "0"
)]
pub disk_cache_inverted_index_meta_size: u64,

/// Max bytes of cached inverted index filters used. Set it to 0 to disable it.
#[clap(
long = "cache-inverted-index-filter-size",
Expand All @@ -3324,6 +3332,14 @@ pub struct CacheConfig {
)]
pub inverted_index_filter_size: u64,

/// Max bytes of cached inverted index filters on disk. Set it to 0 to disable it.
#[clap(
long = "disk-cache-inverted-index-data-size",
value_name = "VALUE",
default_value = "0"
)]
pub disk_cache_inverted_index_data_size: u64,

/// Max percentage of in memory inverted index filter cache relative to whole memory. By default it is 0 (disabled).
#[clap(
long = "cache-inverted-index-filter-memory-ratio",
Expand All @@ -3340,6 +3356,14 @@ pub struct CacheConfig {
)]
pub vector_index_meta_count: u64,

/// Max bytes of cached vector index metadata on disk. Set it to 0 to disable it.
#[clap(
long = "disk-cache-vector-index-meta-size",
value_name = "VALUE",
default_value = "0"
)]
pub disk_cache_vector_index_meta_size: u64,

/// Max bytes of cached vector index filters used. Set it to 0 to disable it.
#[clap(
long = "cache-vector-index-filter-size",
Expand All @@ -3348,6 +3372,14 @@ pub struct CacheConfig {
)]
pub vector_index_filter_size: u64,

/// Max bytes of cached vector index filters on disk. Set it to 0 to disable it.
#[clap(
long = "disk-cache-vector-index-data-size",
value_name = "VALUE",
default_value = "0"
)]
pub disk_cache_vector_index_data_size: u64,

/// Max percentage of in memory vector index filter cache relative to whole memory. By default it is 0 (disabled).
#[clap(
long = "cache-vector-index-filter-memory-ratio",
Expand Down Expand Up @@ -3697,10 +3729,14 @@ mod cache_config_converters {
disk_cache_table_bloom_index_data_size: value
.disk_cache_table_bloom_index_data_size,
inverted_index_meta_count: value.inverted_index_meta_count,
disk_cache_inverted_index_meta_size: value.disk_cache_inverted_index_meta_size,
inverted_index_filter_size: value.inverted_index_filter_size,
disk_cache_inverted_index_data_size: value.disk_cache_inverted_index_data_size,
inverted_index_filter_memory_ratio: value.inverted_index_filter_memory_ratio,
vector_index_meta_count: value.vector_index_meta_count,
disk_cache_vector_index_meta_size: value.disk_cache_vector_index_meta_size,
vector_index_filter_size: value.vector_index_filter_size,
disk_cache_vector_index_data_size: value.disk_cache_vector_index_data_size,
vector_index_filter_memory_ratio: value.vector_index_filter_memory_ratio,
table_prune_partitions_count: value.table_prune_partitions_count,
data_cache_storage: value.data_cache_storage.try_into()?,
Expand Down Expand Up @@ -3737,10 +3773,14 @@ mod cache_config_converters {
disk_cache_table_bloom_index_data_size: value
.disk_cache_table_bloom_index_data_size,
inverted_index_meta_count: value.inverted_index_meta_count,
disk_cache_inverted_index_meta_size: value.disk_cache_inverted_index_meta_size,
inverted_index_filter_size: value.inverted_index_filter_size,
disk_cache_inverted_index_data_size: value.disk_cache_inverted_index_data_size,
inverted_index_filter_memory_ratio: value.inverted_index_filter_memory_ratio,
vector_index_meta_count: value.vector_index_meta_count,
disk_cache_vector_index_meta_size: value.disk_cache_vector_index_meta_size,
vector_index_filter_size: value.vector_index_filter_size,
disk_cache_vector_index_data_size: value.disk_cache_vector_index_data_size,
vector_index_filter_memory_ratio: value.vector_index_filter_memory_ratio,
table_prune_partitions_count: value.table_prune_partitions_count,
data_cache_storage: value.data_cache_storage.into(),
Expand Down
16 changes: 16 additions & 0 deletions src/query/config/src/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,18 +610,30 @@ pub struct CacheConfig {
/// Max number of cached inverted index meta objects. Set it to 0 to disable it.
pub inverted_index_meta_count: u64,

/// Max bytes of cached inverted index meta data on disk. Set it to 0 to disable it.
pub disk_cache_inverted_index_meta_size: u64,

/// Max bytes of cached inverted index filters used. Set it to 0 to disable it.
pub inverted_index_filter_size: u64,

/// Max bytes of cached inverted index filters on disk. Set it to 0 to disable it.
pub disk_cache_inverted_index_data_size: u64,

/// Max percentage of in memory inverted index filters cache relative to whole memory. By default it is 0 (disabled).
pub inverted_index_filter_memory_ratio: u64,

/// Max number of cached vector index meta objects. Set it to 0 to disable it.
pub vector_index_meta_count: u64,

/// Max bytes of cached vector index meta data on disk. Set it to 0 to disable it.
pub disk_cache_vector_index_meta_size: u64,

/// Max bytes of cached vector index filters used. Set it to 0 to disable it.
pub vector_index_filter_size: u64,

/// Max bytes of cached vector index filters on disk. Set it to 0 to disable it.
pub disk_cache_vector_index_data_size: u64,

/// Max percentage of in memory vector index filters cache relative to whole memory. By default it is 0 (disabled).
pub vector_index_filter_memory_ratio: u64,

Expand Down Expand Up @@ -757,10 +769,14 @@ impl Default for CacheConfig {
disk_cache_table_bloom_index_data_size: 0,
disk_cache_table_bloom_index_meta_size: 0,
inverted_index_meta_count: 30000,
disk_cache_inverted_index_meta_size: 0,
inverted_index_filter_size: 64424509440,
disk_cache_inverted_index_data_size: 0,
inverted_index_filter_memory_ratio: 0,
vector_index_meta_count: 30000,
disk_cache_vector_index_meta_size: 0,
vector_index_filter_size: 64424509440,
disk_cache_vector_index_data_size: 0,
vector_index_filter_memory_ratio: 0,
table_prune_partitions_count: 256,
data_cache_storage: Default::default(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ DB.Table: 'system'.'configs', Table: configs-table_id:1, ver:0, Engine: SystemCo
| 'cache' | 'disk.max_bytes' | '21474836480' | '' |
| 'cache' | 'disk.path' | './.databend/_cache' | '' |
| 'cache' | 'disk.sync_data' | 'true' | '' |
| 'cache' | 'disk_cache_inverted_index_data_size' | '0' | '' |
| 'cache' | 'disk_cache_inverted_index_meta_size' | '0' | '' |
| 'cache' | 'disk_cache_table_bloom_index_data_size' | '0' | '' |
| 'cache' | 'disk_cache_table_bloom_index_meta_size' | '0' | '' |
| 'cache' | 'disk_cache_vector_index_data_size' | '0' | '' |
| 'cache' | 'disk_cache_vector_index_meta_size' | '0' | '' |
| 'cache' | 'enable_table_bloom_index_cache' | 'true' | '' |
| 'cache' | 'enable_table_meta_cache' | 'true' | '' |
| 'cache' | 'iceberg_table_meta_count' | '1024' | '' |
Expand Down
8 changes: 4 additions & 4 deletions src/query/storages/common/cache/src/caches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ pub type BloomIndexFilterCache = HybridCache<FilterImpl>;
/// In memory object cache of parquet FileMetaData of bloom index data
pub type BloomIndexMetaCache = HybridCache<BloomIndexMeta>;

pub type InvertedIndexMetaCache = InMemoryLruCache<InvertedIndexMeta>;
pub type InvertedIndexFileCache = InMemoryLruCache<InvertedIndexFile>;
pub type InvertedIndexMetaCache = HybridCache<InvertedIndexMeta>;
pub type InvertedIndexFileCache = HybridCache<InvertedIndexFile>;

pub type VectorIndexMetaCache = InMemoryLruCache<VectorIndexMeta>;
pub type VectorIndexFileCache = InMemoryLruCache<VectorIndexFile>;
pub type VectorIndexMetaCache = HybridCache<VectorIndexMeta>;
pub type VectorIndexFileCache = HybridCache<VectorIndexFile>;

/// In memory object cache of parquet FileMetaData of external parquet rs files
pub type ParquetMetaDataCache = InMemoryLruCache<ParquetMetaData>;
Expand Down
Loading
Loading