在分片时会首先调用FilterBitsBuilder ,将返回的block数据和一个由PartitionedIndexBuilder::GetPartitionKey()生成的一个partition key存储在一起,然后重置FilterBitsBuilder ,以供下次分片使用。最后,每调用一次PartitionedFilterBlockBuilder::Finish,都会返回一个partition以及当前partition用来构建top-level index的offset。
为什么需要partitioned index filters 当DB越来越大,index/filter block所占用的内存越来越大,即使设置了参数cache_index_and_filter_blocks(只把部分index/filter block放置在block cache中), 占较大内存的index/filter block也会影响DB性能 1)占用本来用于缓存data block 的block cache 2 ) 在block cache获取不到...
partition_filters=true This is to enable partitioned filters. metadata_block_size= 4096 This is the block size for index partitions. cache_index_and_filter_blocks=false[if you are on <= 5.14] The partitions are stored in the block cache anyway. This is to control the location of top-leve...