The large amount of data stored in the SSTable requires data caching for optimal query efficiency. Instead of specifying an exact cache size, OceanBase Database adopts a strategy similar to the page cache in Linux, where the memory of tenants is utilized as much as possible until a threshold is reached and cache eviction begins. OceanBase Database is a multi-tenant system and each tenant in the OceanBase Database partitions has its cache. OceanBase Database manages these caches in a unified manner.
OceanBase Database features many different types of cache, including:
Block cache
This is similar to the buffer cache in Oracle which stores data blocks. It stores decompressed microblocks with a variable length.
Block index cache
This stores index to the microblocks and plays a role similar to the intermediate layer of a B-tree. It features a different data structure than the block cache and a higher hit rate in general due to the usually small size of the intermediate layer.
Bloom filter cache
A Bloom Filter is a structure that accelerates the filtering of empty queries and enhances the performance of insert operations. In OceanBase Database, Bloom Filters are based on macroblocks and created on demand. When the number of empty queries on a macroblock exceeds a threshold, a Bloom Filter is created and placed into the cache.
Row cache
Data rows returned by Get/MultiGet queries may be placed in the Row Cache to significantly improve the query performance on frequently queried rows.
Partition location cache
The location information of partitions is placed in the Partition Location Cache to help query routing.
Schema cache
The Schema Cache stores the metadata of tables for generating execution plans as well as subsequent queries.
CLOG cache
The CLog Cache stores CLog data to accelerate Paxo log pulling under some circumstances.