Skip to content

Add optimizer issue handling experience to TiDB query tuning#13

Merged
hawkingrei merged 2 commits intomainfrom
add-tidb-query-tuning
Mar 14, 2026
Merged

Add optimizer issue handling experience to TiDB query tuning#13
hawkingrei merged 2 commits intomainfrom
add-tidb-query-tuning

Conversation

@hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Mar 13, 2026

Summary

This PR adds optimizer issue-handling experience to the tidb-query-tuning skill.

It expands the skill from pure topic references into a mixed knowledge base that now includes:

  • curated stats tuning references
  • redacted optimizer oncall experience files
  • generated GitHub issue-derived customer planner issue files
  • agent guidance for mining new experience from GitHub issues
  • a reusable script for generating issue-based experience corpora

What Changed

  • added three new stats-focused reference docs for:
    • statistics health and auto analyze
    • statistics loading and startup behavior
    • stats version and analyze configuration
  • copied the redacted optimizer oncall experience corpus into skills/tidb-query-tuning/references/optimizer-oncall-experiences-redacted/
  • moved the generated customer planner issue corpus into skills/tidb-query-tuning/references/tidb-customer-planner-issues/
    • 175 issue files
    • 1 generated index README
  • updated skills/tidb-query-tuning/SKILL.md so the skill points to topic docs, redacted field cases, and issue-derived precedents
  • added skills/tidb-query-tuning/AGENTS.md with guidance on when and how to mine GitHub issue experience
  • added skills/tidb-query-tuning/scripts/generate_tidb_issue_experiences.py to generate one-issue-one-file markdown corpora from GitHub issue and PR history

Why

General tuning guidance is not enough for many optimizer problems. A lot of useful handling knowledge exists in field incidents and customer-reported issues:

  • user-facing symptoms
  • investigation signals
  • temporary workarounds
  • fixed versions
  • linked PRs and merge timestamps
  • open gaps that still need attention

This PR makes that knowledge available from the skill itself instead of leaving it in ad hoc output directories.

Validation

  • ran python3 skills/tidb-query-tuning/scripts/generate_tidb_issue_experiences.py --help
  • ran python3 -m py_compile skills/tidb-query-tuning/scripts/generate_tidb_issue_experiences.py

Notes

  • outputs/ was intentionally left out of the tracked changes. The generated issue corpus now lives under the skill's references/ directory.
  • the copied oncall corpus is redacted and intended as reusable operational guidance, not as source-of-record incident material.

@hawkingrei hawkingrei force-pushed the add-tidb-query-tuning branch from fbf4088 to dae1271 Compare March 13, 2026 11:00
@hawkingrei hawkingrei force-pushed the add-tidb-query-tuning branch from dae1271 to 660d49b Compare March 13, 2026 13:08
@terry1purcell terry1purcell self-requested a review March 13, 2026 19:20
@hawkingrei hawkingrei merged commit 8db872c into main Mar 14, 2026
@hawkingrei hawkingrei deleted the add-tidb-query-tuning branch March 14, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants