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

Updated sql-plan-management.md #6184

Merged
merged 4 commits into from
Aug 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: Chengpeng Yan <41809508+Reminiscent@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 20, 2021
commit d07a7f8f15f199f36270514996751f441e0f6f70
14 changes: 7 additions & 7 deletions sql-plan-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ Because the baseline evolution automatically creates a new binding, when the que

+ `read_from_storage` is a special hint in that it specifies whether to read data from TiKV or from TiFlash when reading tables. Because TiDB provides isolation reads, when the isolation condition changes, this hint has a great influence on the evolved execution plan. Therefore, when this hint exists in the initially created binding, TiDB ignores all its evolved bindings.

## Upgrade Checklist
## Upgrade checklist

SQL Plan Management (SPM) may fail in upgrade due to compatibility issues. You need to check the environment before upgrade to make sure it succeeds.
During cluster upgrade, SQL Plan Management (SPM) might cause compatibility issues and make the upgrade fail. To ensure a successful upgrade, you need to include the following list for upgrade precheck:

* When you upgrade from a version earlier than v5.2.0 (that is, v4.0, v5.0, and v5.1) to the current version, make sure `tidb_evolve_plan_baselines` is disabled. If not, you must disable it before upgrade. Perform the following steps.
* When you upgrade from a version earlier than v5.2.0 (that is, v4.0, v5.0, and v5.1) to the current version, make sure that `tidb_evolve_plan_baselines` is disabled before the upgrade. To disable this variable, perform the following steps.

{{< copyable "sql" >}}

Expand All @@ -306,14 +306,14 @@ SQL Plan Management (SPM) may fail in upgrade due to compatibility issues. You n
set global tidb_evolve_plan_baselines = off;
```

* Before you upgrade from v4.0 to the current version, you must check whether the grammar of all the SQL statements corresponding to available SQL bindings is correct in the new version. If any grammatical errors, delete the corresponding SQL bindings. Perform the following steps.
* Before you upgrade from v4.0 to the current version, you need to check whether the syntax of all queries corresponding to the available SQL bindings is correct in the new version. If any syntax errors exist, delete the corresponding SQL binding. To do that, perform the following steps.

{{< copyable "sql" >}}

```sql
-- Check the SQL statements corresponding to available SQL bindings in the version to be upgraded.
-- Check the query corresponding to the available SQL binding in the version to be upgraded.

select bind_sql from mysql.bind_info where source != 'builtin' and status = 'using';
select bind_sql from mysql.bind_info where status = 'using';

-- Verify the result from the above SQL query in the test environment of the new version.

Expand All @@ -322,5 +322,5 @@ SQL Plan Management (SPM) may fail in upgrade due to compatibility issues. You n
...

-- In the case of a syntax error (ERROR 1064 (42000): You have an error in your SQL syntax), delete the corresponding binding.
-- For any other errors (for example, tables are not found), it means the syntax is compatible. No intervention is needed.
-- For any other errors (for example, tables are not found), it means that the syntax is compatible. No other operation is needed.
```