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

test plan effectiveness: output all the considered query plan and execute a specific one #17580

Closed
4 of 5 tasks
Hexilee opened this issue Jun 2, 2020 · 3 comments
Closed
4 of 5 tasks
Labels
epic/access-path feature/accepted This feature request is accepted by product managers priority/P1 The issue has P1 priority. type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@Hexilee
Copy link
Contributor

Hexilee commented Jun 2, 2020

Feature Request

Is your feature request related to a problem? Please describe:

For measuring the effectiveness of optimizer.

Describe the feature you'd like:

proposal : doc

nth_plan(x)

select /*+ nth_plan(x) */ * from t;
  • Indicate the optimizer to use the x_th physical plan generated. (referred as plan's rank in the following paragraphs)
  • Users can take a look at the details by executing explain with nth_plan(x).
  • An error will be thrown if x is too big.

explain format = verbose

explain format = verbose select * from t;

Add two parameters to the result of explain:

  • PlanCount : the number of plans found during optimizing.
  • BestPlanId : the rank of the best plan. (based on estimated cost)

Teachability, Documentation, Adoption, Migration Strategy:

  • test the estimate of the plan cost.
  • help choose the best plan manually.

steps

  • statistic the number of plans found in findBestTask.
  • reallize countdown in findBestTask.
  • add a SQL hint to the parser.
  • add test cases for the hint and plan number statistic.
  • add explain format = verbose.
@Hexilee Hexilee added the type/feature-request Categorizes issue or PR as related to a new feature. label Jun 2, 2020
@zz-jason zz-jason added the priority/P1 The issue has P1 priority. label Jun 6, 2020
@zz-jason zz-jason changed the title Plan designation: query plan list and execute specific plan test plan effectiveness: output all the considered query plan and execute specific a specific one Jun 6, 2020
@zz-jason zz-jason changed the title test plan effectiveness: output all the considered query plan and execute specific a specific one test plan effectiveness: output all the considered query plan and execute a specific one Jun 6, 2020
@danmay319 danmay319 self-assigned this Jun 9, 2020
@zz-jason
Copy link
Member

zz-jason commented Jul 7, 2020

I think we can close this issue since nth_plan has been supported.

@SunRunAway
Copy link
Contributor

@time-and-fate Would you like to add the corresponding documentation for this PR in pingcap/docs-cn sometime?

@time-and-fate
Copy link
Member

@time-and-fate Would you like to add the corresponding documentation for this PR in pingcap/docs-cn sometime?

@SunRunAway Sure. I'll try to do it after I complete my current assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/access-path feature/accepted This feature request is accepted by product managers priority/P1 The issue has P1 priority. type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants