-
Notifications
You must be signed in to change notification settings - Fork 709
Last bulk of special week changes #3392
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
85a3329
Last bulk of special week changes
f632fba
Create credits.md
735062d
put information-scheme.md into folder
64323c9
add sql tuning files
dee4532
to align https://github.com/pingcap/docs-cn/pull/3141/
27fccf2
fix 2 links
da027f6
Merge branch 'master' into pr/3392
298a087
Update control-execution-plan.md
1bfc9dd
add SQL Logical Optimization
d39563d
rename according to docs-cn
b949184
Create sql-physical-optimization.md
b807452
Update sql-optimization-concepts.md
1a0e8d4
update toc
bb02bac
Merge branch 'master' into align-last-sw-changes
yikeke 726707d
Merge branch 'master' into align-last-sw-changes
lilin90 b8b630b
Merge branch 'master' into align-last-sw-changes
lilin90 c2facce
Apply suggestions from code review
yikeke 94e8690
Merge branch 'master' into align-last-sw-changes
ti-srebot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| title: Control Execution Plan | ||
| --- | ||
|
|
||
| # Control Execution Plan | ||
|
|
||
| The first two chapters of SQL Tuning introduce how to understand TiDB's execution plan and how TiDB generates an execution plan. This chapter introduces what methods can be used to control the generation of the execution plan when you determine the problems with the execution plan. This chapter mainly includes the following three aspects: | ||
|
|
||
| - In [Optimizer Hints](/optimizer-hints.md), you will learn how to use hints to guide TiDB to generate an execution plan. | ||
| - But hints change the SQL statement intrusively. In some scenarios, hints cannot be simply inserted. In [SQL Plan Management](/sql-plan-management.md), you will know how TiDB uses another syntax to non-intrusively control the generation of execution plans, and the methods of automatic execution plan evolution in the background to alleviate the execution plan instability caused by reasons such as version upgrades, which degrades cluster performance. | ||
| - Finally, you will learn how to use the blocklist in [Blocklist of Optimization Rules and Expression Pushdown](/blocklist-control-plan.md). |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| title: SQL Logical Optimization | ||
| --- | ||
|
|
||
| # SQL Logical Optimization | ||
|
|
||
| This chapter explains some key logic rewrites to help you understand how TiDB generates the final query plan. For example, when you execute the `select * from t where t.a in (select * from t1 where t1.b=t.b)` query in TiDB, you will find that the `IN` sub-query `t.a in (select t1.a from t1 where t1.b=t.b` does not exist because TiDB has made some rewrites here. | ||
|
|
||
| This chapter introduces the following key rewrites: | ||
|
|
||
| - [Subquery Related Optimizations](/subquery-optimization.md) | ||
| - [Column Pruning](/column-pruning.md) | ||
| - [Decorrelation of Correlated Subquery](/correlated-subquery-optimization.md) | ||
| - [Eliminate Max/Min](/max-min-eliminate.md) | ||
| - [Predicates Push Down](/predicate-push-down.md) | ||
| - [Partition Pruning](/partition-pruning.md) | ||
| - [TopN and Limit Operator Push Down](/topn-limit-push-down.md) | ||
| - [Join Reorder](/join-reorder.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| title: SQL Physical Optimization | ||
| --- | ||
|
|
||
| # SQL Physical Optimization | ||
|
|
||
| Physical optimization is cost-based optimization, which makes a physical execution plan for the logical execution plan generated in the previous stage. In this stage, the optimizer selects a specific physical implementation for each operator in the logical execution plan. Different physical implementations of logical operators have different time complexity, resource consumption and physical properties. In this process, the optimizer determines the cost of different physical implementations based on the statistics of the data, and selects the physical execution plan with the smallest overall cost. | ||
|
|
||
| [Understand the Query Execution Plan](/query-execution-plan.md) has introduced some physical operators. This chapter focuses on the following aspects: | ||
|
|
||
| - In [Index Selection](/choose-index.md), you will learn how to select the optimal index to access tables when TiDB has multiple indexes on a table. | ||
| - In [Introduction to Statistics](/statistics.md), you will learn what statistics TiDB collects to obtain the data distribution of a table. | ||
| - [Wrong Index Solution](/wrong-index-solution.md) introduces how to use the right index when you find the index is selected wrongly. | ||
| - [Distinct Optimization](/agg-distinct-optimization.md) introduces an optimization related to the `DISTINCT` keyword during physical optimization. In this section, you will learn its advantages and disadvantages and how to use it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| title: SQL Tuning Overview | ||
| --- | ||
|
|
||
| # SQL Tuning Overview | ||
|
|
||
| The previous "Troubleshoot" chapter describes some ways to locate some queries that affect the cluster, and that if some queries' execution time does not meet expectations, you need to analyze the execution result to find the cause. In this chapter, the following sections introduce how to tune a specific query: | ||
|
|
||
| - In the first section, [Understand the Query Execution Plan](/query-execution-plan.md) introduces how to use the `EXPLAIN` and `EXPLAIN ANALYZE` statements to understand how TiDB executes a query. | ||
| - In the second section, [SQL Optimization Process](/sql-optimization-concepts.md) introduces the optimizations used internally by TiDB, which involves some equivalent SQL conversions and the selection of physical plans. This section helps you understand how TiDB generates the final execution plan. | ||
| - In the third section, [Control Execution Plan](/control-execution-plan.md) introduces the ways to control the generation of the execution plan, which improves the execution speed of the query and reduces its impact on the overall performance of the cluster or online business. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.