Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: SHOW STATS_META 底层查询的哪张元数据表
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] 5.X
[Encountered Problem]
SHOW STATS_META where table_name =‘account’
select cannot be associated with show query, so I want to know which table is used by show stats_meta at the bottom layer, so that I can directly query the underlying table for join
[Reproduction Path] What operations were performed to encounter the problem
[Problem Phenomenon and Impact]
[Attachment]
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.
select * from mysql.stats_meta but need to do a little calculation
How to calculate it slightly?
This table does not have a date field.
mysql> select tidb_parse_tso(436731556544118797);
±-----------------------------------+
| tidb_parse_tso(436731556544118797) |
±-----------------------------------+
| 2022-10-17 17:24:34.561000 |
±-----------------------------------+
1 row in set (0.00 sec)
mysql> show stats_meta;
±--------±----------------------------±---------------±--------------------±-------------±----------+
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
±--------±----------------------------±---------------±--------------------±-------------±----------+
| sbtest | sbtest1 | | 2022-10-17 17:24:34 | 0 | 1000 |
| test | t | | 2022-10-10 14:01:06 | 0 | 0 |
| test | offline_activity | | 2022-10-17 14:09:04 | 0 | 0 |
| test | offline_activity_agent_sign | | 2022-10-17 14:09:22 | 0 | 0 |
| test | offline_activity_cust_sign | | 2022-10-17 14:09:37 | 0 | 0 |
±--------±----------------------------±---------------±--------------------±-------------±----------+
5 rows in set (0.00 sec)
mysql> select * from mysql.stats_meta ;
±-------------------±---------±-------------±------±-------------------+
| version | table_id | modify_count | count | snapshot |
±-------------------±---------±-------------±------±-------------------+
| 436569811546275850 | 99 | 0 | 0 | 0 |
| 436728481542832134 | 103 | 0 | 0 | 0 |
| 436728486326697990 | 105 | 0 | 0 | 0 |
| 436728490127785995 | 107 | 0 | 0 | 0 |
| 436731556557488129 | 113 | 0 | 1000 | 436731556544118797 |
±-------------------±---------±-------------±------±-------------------+
5 rows in set (0.00 sec)
mysql>
Damn, which version is this? Why don’t I have it?
By joining the INFORMATION_SCHEMA.TABLES, this table will have a time field.
Did you create this method yourself?
What is going on here, fk
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.