Skip to content

master: add doc for tidb_enable_cache_prepare_stmt#23216

Merged
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
qiancai:cache_prepare_stmt-21574
Jul 8, 2026
Merged

master: add doc for tidb_enable_cache_prepare_stmt#23216
ti-chi-bot[bot] merged 6 commits into
pingcap:masterfrom
qiancai:cache_prepare_stmt-21574

Conversation

@qiancai

@qiancai qiancai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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 (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@qiancai qiancai added needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3. labels Jul 8, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@ti-chi-bot ti-chi-bot Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 8, 2026
Synced from: pingcap/docs-cn#21574
Target PR: pingcap#23216
AI Provider: azure

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Auto-sync completed successfully

Source PR: pingcap/docs-cn#21574
Target PR: #23216

English documentation has been updated based on Chinese documentation changes.

@ti-chi-bot ti-chi-bot Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 8, 2026
@qiancai

qiancai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

Comment thread system-variables.md Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request documents a new system variable, tidb_enable_cache_prepare_stmt, which controls the caching of prepared statement results. The review feedback focuses on aligning the documentation with the style guide by reducing passive voice, addressing the user in the second person, and using uppercase for SQL statements like PREPARE and EXECUTE.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread system-variables.md Outdated

> **Warning:**
>
> Currently, this variable is an experimental feature and is not recommended to be enabled in the production environment. This variable might be changed or removed without prior notice. If you find a bug, you can submit an [issue](https://github.com/pingcap/tidb/issues) on GitHub.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The warning message uses passive voice ("is not recommended to be enabled") and singular "production environment". To improve clarity and adhere to the style guide, use active voice and plural "production environments".

Suggested change
> Currently, this variable is an experimental feature and is not recommended to be enabled in the production environment. This variable might be changed or removed without prior notice. If you find a bug, you can submit an [issue](https://github.com/pingcap/tidb/issues) on GitHub.
> Currently, this variable is an experimental feature and is not recommended for use in production environments. This variable might be changed or removed without prior notice. If you find a bug, you can submit an [issue](https://github.com/pingcap/tidb/issues) on GitHub.
References
  1. Avoid passive voice overuse and ensure documentation is easy to understand. (link)

Comment thread system-variables.md Outdated
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Boolean
- Default value: `OFF`
- This variable controls whether to cache the results of `Prepare` statements. Typically, an application only needs to execute `Prepare` once and then execute `Execute` multiple times. All subsequent `Execute` operations can reuse the results generated by the first `Prepare`. If the application needs to repeatedly send the same `Prepare` statement, you can enable this variable so that TiDB can cache and reuse the processing results of identical `Prepare` statements, thereby reducing resource consumption.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

To maintain terminology consistency and adhere to the style guide, use uppercase PREPARE and EXECUTE when referring to SQL statements. Additionally, write in the second person ("your application") and simplify the phrasing to avoid passive voice ("results generated by").

Suggested change
- This variable controls whether to cache the results of `Prepare` statements. Typically, an application only needs to execute `Prepare` once and then execute `Execute` multiple times. All subsequent `Execute` operations can reuse the results generated by the first `Prepare`. If the application needs to repeatedly send the same `Prepare` statement, you can enable this variable so that TiDB can cache and reuse the processing results of identical `Prepare` statements, thereby reducing resource consumption.
- This variable controls whether to cache the results of `PREPARE` statements. Typically, an application only needs to execute `PREPARE` once and then execute `EXECUTE` multiple times. All subsequent `EXECUTE` operations can reuse the results of the first `PREPARE`. If your application repeatedly sends the same `PREPARE` statement, you can enable this variable so that TiDB can cache and reuse the processing results of identical `PREPARE` statements, thereby reducing resource consumption.
References
  1. Use consistent terminology, write in second person, and avoid passive voice. (link)

Comment thread system-variables.md Outdated
Comment thread system-variables.md Outdated
Comment thread system-variables.md Outdated
@qiancai qiancai self-assigned this Jul 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

@qw4990: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

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.

Comment thread system-variables.md Outdated
@qiancai

qiancai commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@qiancai qiancai added the lgtm label Jul 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiancai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Jul 8, 2026
@ti-chi-bot ti-chi-bot Bot merged commit 3099df3 into pingcap:master Jul 8, 2026
11 checks passed
@ti-chi-bot

Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #23219.

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

Labels

approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v9.0-beta.3 This PR/issue applies to TiDB v9.0-beta.3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants