-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ease of use: The stats_meta data table adds two fields related to statistics collection. #49594
Comments
You can get this information from the For instance: +---------+---------------------+--------------+--------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+--------------------------------------------------+-------------------------------------------------------------------------+------------+
| 2670123 | 2023-12-27 10:38:34 | co01db33 | co01table86 | | auto analyze table all columns with 256 buckets, 500 topn, 1 samplerate | 150000 | 2023-12-27 10:38:31 | 2023-12-27 10:38:34 | finished | NULL | tc-tidb-0.tc-tidb-peer.partition-analyze-test-tps-3180202-1-85.svc:4000 | NULL |
| 2670124 | 2023-12-27 10:49:00 | co01db33 | co01table125 | | auto analyze table all columns with 256 buckets, 500 topn, 1 samplerate | 0 | 2023-12-27 10:38:34 | NULL | failed | TiDB Server is down when running the analyze job | tc-tidb-0.tc-tidb-peer.partition-analyze-test-tps-3180202-1-85.svc:4000 | NULL |
+---------+---------------------+--------------+--------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------+---------------------+---------------------+----------+--------------------------------------------------+-------------------------------------------------------------------------+------------+ |
The table definition is: CREATE TABLE IF NOT EXISTS mysql.analyze_jobs (
id BIGINT(64) UNSIGNED NOT NULL AUTO_INCREMENT,
update_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
table_schema CHAR(64) NOT NULL DEFAULT '',
table_name CHAR(64) NOT NULL DEFAULT '',
partition_name CHAR(64) NOT NULL DEFAULT '',
job_info TEXT NOT NULL,
processed_rows BIGINT(64) UNSIGNED NOT NULL DEFAULT 0,
start_time TIMESTAMP,
end_time TIMESTAMP,
state ENUM('pending', 'running', 'finished', 'failed') NOT NULL,
fail_reason TEXT,
instance VARCHAR(512) NOT NULL comment 'address of the TiDB instance executing the analyze job',
process_id BIGINT(64) UNSIGNED comment 'ID of the process executing the analyze job',
PRIMARY KEY (id),
KEY (update_time) If the job_info starts with |
@hi-rustin the mysql.analyze_jobs table ease of use is poor,a final intuitive information is needed, not a process state. The table is used to collect historical records in increments. The second one may require manual sorting to remove duplicates and find the maximum time, because a certain table will be recorded after multiple collections. The third One has to like to judge autoanalyze |
I acknowledge that it has some usability issues. However, recording only the last analysis time is also quite unreasonable. If the purpose of this requirement is to audit and analyze historical data, then analyze_jobs is the best source. stats meta does not record the time of the last analysis because analysis can either succeed or fail. Do we really need to store this information again in stats meta? In that case, stats meta would essentially become the same as the analyze_jobs table. |
@hi-rustin
|
Feature Request
Is your feature request related to a problem? Please describe:
Ease of use: The stats_meta data table adds two fields related to statistics collection. One field represents the last table analyze statistics collection time, and the other field represents the source of the last table analyze statistics (internal automatic collection or external manual collection).
Describe the feature you'd like:
Ease of use: The stats_meta data table adds two fields related to statistics collection. One field represents the last table analyze statistics collection time, and the other field represents the source of the last table analyze statistics (internal automatic collection or external manual collection).
Describe alternatives you've considered:
NO
Teachability, Documentation, Adoption, Migration Strategy:
Scenes:
The text was updated successfully, but these errors were encountered: