Skip to content

Conversation

@qiancai
Copy link
Owner

@qiancai qiancai commented Oct 21, 2025

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

Summary by CodeRabbit

  • Documentation
    • Added documentation for the new tidb_opt_selectivity_factor system variable (v9.0.0+). This float-type variable, available in SESSION and GLOBAL scope, accepts values in range [0, 1] with a default of 0.8.

@gemini-code-assist
Copy link

Summary of Changes

Hello @qiancai, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request, despite its title suggesting an update to system-variables.md, primarily introduces a new file named temp.md containing simple test content, as per the provided patch. The PR description and an automated summary, however, outline an intent to document new system variables for optimizer selectivity and executor concurrency, implying a broader scope not fully reflected in the current patch.

Highlights

  • New File Added: A new file named temp.md has been added to the repository, containing simple test content.
  • Stated Documentation Update: The pull request's title and automated summary indicate an intention to update the system-variables.md documentation.
  • New System Variables (Stated): The PR description mentions the introduction of a new system variable tidb_opt_selectivity_factor for controlling optimizer selectivity, and per-operator executor concurrency controls (e.g., for index lookup, hash join, projection, window operators).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

  Synced from: qiancai/docs-cn#15
  Target PR: #50
  AI Provider: gemini

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

🤖 Auto-sync completed successfully

📥 Source PR: qiancai/docs-cn#15
🎯 Target PR: #50
✅ English documentation has been updated based on Chinese documentation changes.

This comment was generated automatically by the sync workflow.

Copy link

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

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 introduces a new file, temp.md, which appears to be a test file. There is a discrepancy between the file changes and the pull request's title and description, which refer to updates for system-variables.md. For clarity, please consider aligning the PR's metadata with its content. My review is based on the provided file change, and I have one minor suggestion to adhere to common file formatting conventions.

@coderabbitai
Copy link

coderabbitai bot commented Oct 21, 2025

Walkthrough

A new system variable tidb_opt_selectivity_factor is added to TiDB v9.0.0 documentation. The variable controls default optimizer selectivity with SESSION | GLOBAL scope, float type, range [0, 1], and default value 0.8, applying when predicate statistics are unavailable.

Changes

Cohort / File(s) Summary
System Variables Documentation
system-variables.md
Adds new system variable tidb_opt_selectivity_factor (v9.0.0) with scope SESSION | GLOBAL, persists to cluster, float type [0, 1], default 0.8, for specifying default selectivity when predicate statistics unavailable

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A factor new hops into view,
Selectivity set just right and true,
Point-eight by day, a fuzzy friend,
When stats don't speak, on this we'll depend!
wiggles nose 📊✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is largely incomplete. The two required sections of the template are either empty or unchecked: the "What is changed, added or deleted?" section contains no description of the actual changes, and the "Which TiDB version(s) do your changes apply to?" section has no version checkboxes selected. While a reference link to the related docs-cn PR is provided, the absence of these critical required sections means reviewers lack essential context about what was added and which versions are affected. The CLA checkbox remains unchecked, though this may be acceptable for a first-time contributor. Please complete the required sections of the PR template by: (1) explaining in the "What is changed, added or deleted?" section that you added the tidb_opt_selectivity_factor system variable documentation for v9.0.0, and (2) selecting the appropriate version checkbox(es) that this change applies to (likely v9.0 and master based on the raw summary). Additionally, first-time contributors should sign the CLA as indicated by the unchecked box.
Title Check ❓ Inconclusive The pull request title "Update system-variables.md" is vague and generic. While it is technically related to the changeset (the file being modified is indeed system-variables.md), it provides no meaningful information about what was actually changed. According to the raw summary, the primary change is the addition of a new system variable tidb_opt_selectivity_factor introduced in v9.0.0, but this specificity is entirely absent from the title. The title could apply to any update to the file, leaving readers unable to quickly understand the actual contribution from scanning the PR history alone.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-add-a-variable-15

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
system-variables.md (1)

1796-1803: Align attribute list with house style.

Please match the field labels and value formatting used by other variables (for example tidb_default_string_match_selectivity) so the table stays consistent and scannable: “Persists to cluster: …”, “Applies to hint …”, “Type: Float”, “Range: …” etc. The current mix of sentence casing and wording breaks the established pattern and makes the entry harder to read. Suggested edit:

- Is persisted to the cluster: Yes
- Is controlled by the Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
- Type: Floating-point number
- Value range: `[0, 1]`
+ - Persists to cluster: Yes
+ - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes
+ - Type: Float
+ - Range: `[0, 1]`
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcea1e9 and 3edad37.

📒 Files selected for processing (1)
  • system-variables.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

⚙️ CodeRabbit configuration file

As a technical writer in the database area, you need to first learn the changes in this PR, and then improve the content to make it clear, concise, and easy to understand in English according to your database knowledge.

Files:

  • system-variables.md

@qiancai
Copy link
Owner Author

qiancai commented Oct 21, 2025

/gemini review

Copy link

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

Choose a reason for hiding this comment

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

Code Review

The pull request adds documentation for the tidb_opt_selectivity_factor system variable, which is introduced in v9.0.0. The variable is of float type, available in SESSION and GLOBAL scope, accepts values in the range [0, 1], and has a default value of 0.8. The documentation also states that it is not recommended to modify this value. I have provided a suggestion to improve the clarity of the documentation.

- Type: Floating-point number
- Value range: `[0, 1]`
- Default value: `0.8`
- This variable is used to specify the default selectivity of the TiDB optimizer. In some cases, when the optimizer cannot derive the predicate selectivity based on statistics, the optimizer uses this default selectivity as an alternative value. **It is not recommended** to modify this value.

Choose a reason for hiding this comment

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

medium

To improve clarity, consider rephrasing this sentence to emphasize the potential negative consequences of modifying this variable. For example: "Modifying this value is strongly discouraged as it can significantly impact query optimization and performance."

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants