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

Plan recreator development task #1277

Closed
4 tasks
rebelice opened this issue Jul 19, 2021 · 1 comment
Closed
4 tasks

Plan recreator development task #1277

rebelice opened this issue Jul 19, 2021 · 1 comment
Assignees

Comments

@rebelice
Copy link
Contributor

Plan Recreator

Provide all the information required to reproduce the implementation plan for import/export. Provide a simple, one-stop collection and retention of the event of the scene, simplifying the inspection information extraction steps of the optimizer-related issues.

Description

PLAN RECREATOR provides two features:

  • One-click Export/Import Information Reproducing Single SQL
  • One-click Export/Importing Information Reproducing Slow Queries
    Dump for one SQL
tidb> plan recreator dump explain [analyze] sqlStmt
  • sqlStmt parameter is the specified SQL statement
  • explain [Analyze] is used to specify back explain or Explain Analyze information
  • This statement will return a single-active URL for download files such as http://${tidb-server-ip}:${tidb-server-status-port}/plan-recreator/dump/xxxx

Dump for slow queries

tidb> plan recretor dump explain [analyze] slow query [filtering]
  • explain [Analyze] is used to specify back explain or Explain Analyze information
  • [filtering] is used to filter slow inquiry in Slow Query Table, support:
    • WHERE
    • ORDER BY
    • Limit
  • This statement will return a single-active URL for download files such as http://${tidb-server-ip}:${tidb-server-status-port}/plan-recreator/dump/xxxx

Load Information

tidb> plan recreator load 'file_name'

File Format
The file plan-recreator.zip format is as follows:

|-meta.txt
|-schema.sql
|-stats
|   |-stats1.json
|   |-stats2.json
|   |-....
|-config.toml
|-variables.toml
|-bindings.sql
|-sqls.sql
|_explain
    |-explain1.txt
    |-explain2.txt

Development task

  • Modify parser to add PLAN RECREATOR statement
  • Modify tidb/executor to implement plan recreator
  • Add a HTTP handler to download files
  • Tests
@rebelice rebelice self-assigned this Jul 19, 2021
@rebelice
Copy link
Contributor Author

I move it to tidb/issues/26325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant