-
Notifications
You must be signed in to change notification settings - Fork 687
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
A Practical Guide For SQL Tuning #19108
base: master
Are you sure you want to change the base?
Conversation
Hi @dbsid. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
TiDB uses a cost-based optimizer (CBO) to determine the most efficient execution plan for a SQL statement. This optimizer evaluates different execution strategies and chooses the one with the lowest estimated cost. The cost is influenced by factors such as: | ||
|
||
- SQL | ||
- Schema Design |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a section about the schema design? For example, do not use auto-increment attribute if you need to specify a specific value for this column; do not use partition table when data were not cleaned up by partitions. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think after we put the best practice for the partition table online, we can add a schema design session and link to the partition table document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And looks like the format and terminology also need improvement. Like
- Wrap `` for column/table names, text from SQL text, texts from EXPLAIN ANALYZE, operator names, etc.
- Unify the capitalizations. Like "hash join", "Hash Join", "
HashJoin
", "TOPN", "TopN", "TopN
", "top-N", "Point Get", "Point_Get", etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My review part 1. Good structure and clear explanations, only some minor suggestions, feel free to ignore :)
Co-authored-by: Mattias Jonsson <[email protected]>
Co-authored-by: Mattias Jonsson <[email protected]> Co-authored-by: Zhou Kunqin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job with examples and explanations. I only have some minor questions and suggestions!
@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
TiDB layer --> TiDB Server TiKV layer --> TiKV TiFlash layer --> TiFlash
Update sql-tuning-best-practice.md
@Yui-Song: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?