information_schema.PERSIST_RANGE_CACHE is used to view the contents of the instance's persistent range statistics cache.PERSIST_RANGE_CACHE view displays the portion of these statistics that has been persisted and can be automatically recovered after a node restart, helping you:RANGE_CACHE to confirm their consistency.PERSIST_RANGE_CACHE view are shown in the following table:Field Name | Type | Description |
TABLE_SCHEMA | varchar(192) | The database name to which the table of this range statistic belongs. |
TABLE_NAME | varchar(192) | The table name to which the range statistic belongs. |
INDEX_NAME | varchar(192) | The name of the index to which the range statistic belongs; primary key statistics are displayed as PRIMARY. |
RANGE_CACHE_MISS | bigint unsigned | The cumulative number of misses for this index in the range statistics cache, which can be used to evaluate the cache hit rate. |
RANGE_CACHE_SAMPLE_ROWS | bigint unsigned | The total number of rows sampled during the most recent complete rebuild of the index range statistics, used for estimating the total number of rows in the table. |
RANGE_CACHE_REFILL_TS | bigint unsigned | The timestamp of the most recent complete rebuild of the index range statistics, formatted as a readable value in the YYYYMMDDhhmmss format. |
START_KEY | varchar(192) | The start key of the range (in a readable string format). |
END_KEY | varchar(192) | The end key of the range (in a readable string format). |
RANGE_ROWS | bigint unsigned | The estimated number of rows within the range (START_KEY, END_KEY]. |
RANGE_ACC_ROWS | bigint unsigned | Cumulative row estimation: the total estimated number of rows accumulated from the minimum key of the index to END_KEY, used for cross-range cumulative estimation. |
RANGE_TIMESTAMP | bigint unsigned | The timestamp generated for this specific range statistic, formatted as a readable value in the YYYYMMDDhhmmss format. |
PERSIST_RANGE_CACHE and RANGE_CACHE are identical, with the only difference being their data sources:RANGE_CACHE: the range statistics cached in the current node's memory.PERSIST_RANGE_CACHE: the complete range statistics that have been persisted and can be automatically recovered after a node restart. The range statistics cached in memory are only a subset, limited by the maximum capacity of the range cache.SELECT TABLE_SCHEMA,TABLE_NAME,INDEX_NAME,START_KEY,END_KEY,RANGE_ROWS,RANGE_ACC_ROWS,RANGE_TIMESTAMPFROM information_schema.PERSIST_RANGE_CACHEWHERE TABLE_SCHEMA = 'your_db'AND TABLE_NAME = 'your_table'ORDER BY INDEX_NAME, START_KEY;
SELECT *FROM information_schema.RANGE_CACHEWHERE CONCAT(START_KEY, ' ', END_KEY) NOT IN (SELECT CONCAT(START_KEY, ' ', END_KEY)FROM information_schema.PERSIST_RANGE_CACHE);
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback