Which metadata table does SHOW STATS_META query?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: SHOW STATS_META 底层查询的哪张元数据表

| username: 大飞飞呀

[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.

| username: weixiaobing | Original post link

select * from mysql.stats_meta but need to do a little calculation

| username: 大飞飞呀 | Original post link

How to calculate it slightly?

| username: 大飞飞呀 | Original post link

This table does not have a date field.

| username: neolithic | Original post link

Do a 10046 trace :joy::joy::joy:

| username: weixiaobing | Original post link

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>

| username: 大飞飞呀 | Original post link

Damn, which version is this? Why don’t I have it?

| username: forever | Original post link

By joining the INFORMATION_SCHEMA.TABLES, this table will have a time field.

| username: 大飞飞呀 | Original post link

Did you create this method yourself?

| username: 大飞飞呀 | Original post link

What is going on here, fk

| username: Lucien-卢西恩 | Original post link

Check this out: TiDB 特有的函数 | PingCAP 归档文档站

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.