-
Notifications
You must be signed in to change notification settings - Fork 0
Update system-variables.md #51
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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 introduces a new file, Highlights
Using Gemini Code AssistThe 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
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 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
|
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.
Code Review
This pull request adds a file named temp.md that appears to be a test file, as its content is simply "This is a test file.". This file seems unsuitable for the documentation. Furthermore, the pull request title, "Update system-variables.md", does not match the changes in this PR. Please clarify the purpose of this pull request; if it was created by mistake, it should be closed.
Synced from: qiancai/docs-cn#16 Target PR: #51 AI Provider: gemini Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
|
Auto-sync completed successfully Source PR: qiancai/docs-cn#16 |
WalkthroughA new system variable Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
| ### `tidb_opt_selectivity_factor` <span class="version-mark">Introduced in v9.0.0</span> | ||
| - Scope: SESSION | GLOBAL | ||
| - Persist to cluster: Yes | ||
| - Controlled by hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): Yes | ||
| - Type: Floating-point number | ||
| - Value range: `[0, 1]` | ||
| - Default value: `0.8` | ||
| - This variable specifies 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. **We do not recommend** modifying this value. | ||
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.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Align wording with house style; tighten description; consider relocating under tidb_opt_ block*
- Use “New in v9.0.0”, “Persists to cluster”, “Applies to hint [SET_VAR]”, type “Float”, and label “Range” to match conventions.
- Prefer the stronger “It is NOT recommended to modify this variable.” used elsewhere.
- Optional: Move this entry down to the tidb_opt_* section to keep variables grouped consistently.
-### `tidb_opt_selectivity_factor` <span class="version-mark">Introduced in v9.0.0</span>
+### `tidb_opt_selectivity_factor` <span class="version-mark">New in v9.0.0</span>
- Scope: SESSION | GLOBAL
-- Persist to cluster: Yes
-- Controlled by 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]`
- Default value: `0.8`
-- This variable specifies 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. **We do not recommend** modifying this value.
+- Specifies the default predicate selectivity the optimizer uses when statistics cannot estimate selectivity (for example, complex expressions or missing stats). Lower values assume more selective predicates and influence cardinality estimates and plan choices. It is NOT recommended to modify this value; instead, prefer improving statistics collection.To ensure no duplicate entries slipped in, please run:
🏁 Script executed:
#!/bin/bash
rg -n "tidb_opt_selectivity_factor" system-variables.md -C2Length of output: 436
I need to verify whether the suggested conventions in the review comment actually match the file's established style. Let me check the documentation patterns:
🏁 Script executed:
#!/bin/bash
# Check patterns for version markers, type labels, and attribute naming
rg -n "Introduced in|New in" system-variables.md | head -20
rg -n "Persist|Persists" system-variables.md | head -20
rg -n "Floating-point|Float|Integer|Boolean" system-variables.md | head -20
rg -n "Value range|Range:" system-variables.md | head -20
rg -n "Controlled by hint|Applies to hint" system-variables.md | head -20Length of output: 299
---
🏁 Script executed:
```shell
#!/bin/bash
# Locate the file
fd -t f "system-variables.md"
Length of output: 19
🏁 Script executed:
#!/bin/bash
# Check patterns for version markers, type labels, and attribute naming
echo "=== Version markers ==="
rg -n "Introduced in|New in" system-variables.md | head -10
echo ""
echo "=== Persist/Persists usage ==="
rg -n "Persist to cluster|Persists to cluster" system-variables.md | head -10
echo ""
echo "=== Type labels ==="
rg -n "Type:.*Floating-point|Type:.*Float|Type:.*Integer|Type:.*Boolean" system-variables.md | head -10
echo ""
echo "=== Range labels ==="
rg -n "Value range|^- Range:" system-variables.md | head -10
echo ""
echo "=== Hint references ==="
rg -n "Controlled by hint|Applies to hint" system-variables.md | head -10Length of output: 4040
🏁 Script executed:
#!/bin/bash
# Search more broadly for type labels including Floating-point
echo "=== All Floating-point type labels ==="
rg -n "Type: Floating-point" system-variables.md
echo ""
echo "=== All Float type labels ==="
rg -n "Type: Float" system-variables.md
echo ""
echo "=== Find tidb_opt_ variables ==="
rg -n "tidb_opt_" system-variables.md | head -20
echo ""
echo "=== Recommendation phrasing patterns ==="
rg -n "NOT recommended|do not recommend|We do not recommend|It is NOT" system-variables.md | head -10Length of output: 4273
Fix style inconsistencies: use "New", "Persists to cluster", "Applies to hint", "Float", "Range", and "It is NOT recommended"
Multiple attributes do not match established file conventions:
- Version marker: "Introduced in" should be "New in" (see lines 55, 64, 74, etc.)
- Persist attribute: "Persist to cluster" should be "Persists to cluster" (see lines 58, 67, 77, etc.)
- Hint attribute: "Controlled by hint" should be "Applies to hint" (see lines 59, 68, 78, etc.)
- Type: "Floating-point number" should be "Float" (see line 1260, 1810, 3454, and 40+ other occurrences)
- Attribute: "Value range" should be "Range" (see lines 117, 127, 146, etc.)
- Recommendation: "We do not recommend" should be "It is NOT recommended" (see lines 339, 371, 2334, etc.)
Optional: Move this entry to the tidb_opt_* variables section around line 4153 for consistency with other optimizer settings.
-### `tidb_opt_selectivity_factor` <span class="version-mark">Introduced in v9.0.0</span>
+### `tidb_opt_selectivity_factor` <span class="version-mark">New in v9.0.0</span>
- Scope: SESSION | GLOBAL
-- Persist to cluster: Yes
-- Controlled by 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]`
- Default value: `0.8`
-- This variable specifies 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. **We do not recommend** modifying this value.
+- This variable specifies 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.
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).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?
Summary by CodeRabbit
tidb_opt_selectivity_factorsystem variable (v9.0.0) with configuration details including scope, persistence settings, type constraints, range, and default value.