Skip to content
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

Merge in Workload Repository from #57147

Open
wddevries opened this issue Nov 5, 2024 · 0 comments
Open

Merge in Workload Repository from #57147

wddevries opened this issue Nov 5, 2024 · 0 comments
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@wddevries
Copy link
Contributor

wddevries commented Nov 5, 2024

The workload repository will persist workload metrics for use by the planner and statistics systems. These data will be used by:

  • the Statistics Advisor, which will help determine statistics loading priorities,
  • the Index Advisor, which will make recommendations about indexes,
  • the SQL tuning and SQL binding advisor,

Select tables will be sampled by two different methods at regular intervals, and persist the results into the "workload_schema" database. Sampled tables are node-specific and each TiDB instance will sample and write these data independently.

Some tables will be sampled on an interval between 1 and 600 seconds.
The data from each of these tables will be sampled and recorded in the corresponding tables in 'workload_schema' along with the sampling timestamp and instance id. These tables include:

  • PROCESSLIST
  • DATA_LOCK_WAITS
  • TIDB_TRX MEMORY_USAGE
  • DEADLOCKS CLUSTER_LOAD
  • TIDB_HOT_REGIONS
  • TIKV_STORE_STATUS

Other tables will be sampled as part of a snapshot process, which will run every 15 minutes to 2 hours. When a snapshot is initialized, one row will be written into HIST_SNAPSHOTS, which will contain the snapshot id, the start and end timestamps, and server version information. The data from each of the following tables will be sampled and recorded in the corresponding tables in 'workload_schema' along with the sampling timestamp, instance id and snapshot id:

  • CLIENT_ERRORS_SUMMARY_BY_HOST
  • CLIENT_ERRORS_SUMMARY_BY_USER
  • CLIENT_ERRORS_SUMMARY_GLOBAL
  • TIKV_REGION_STATUS
  • TIDB_STATEMENTS_STATS

Other tables will probably be added to these lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant