Skip to content

Conversation

@Frank945946
Copy link
Collaborator

@Frank945946 Frank945946 commented Nov 6, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

Add limitations on import and index creation for TiDB X Premium

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.

  • 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)?

  • This PR is translated from:
  • Other reference 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

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. area/develop This PR relates to the area of TiDB App development. missing-translation-status This PR does not have translation status info. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 6, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @Frank945946, 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 delivers a substantial update to the TiDB documentation, focusing on clarity, accuracy, and the introduction of new features across both TiDB Cloud and Self-Managed offerings. Key changes include the addition of specific Table of Contents for different TiDB Cloud tiers, a major overhaul of the overall documentation structure, and detailed guides for new functionalities like advanced index management and batch processing. These updates aim to provide users with more precise and comprehensive resources for developing, deploying, and optimizing their TiDB applications.

Highlights

  • New TiDB Cloud Tier Documentation: Introduced dedicated Table of Contents files for TiDB Cloud Essential, Premium, and Starter tiers, providing tailored navigation for different service levels.
  • Comprehensive TOC Restructuring: Performed significant restructuring and updates to the main Table of Contents for both TiDB Cloud and TiDB Self-Managed, enhancing organization and discoverability of documentation.
  • Enhanced Index Management Features: Added new documentation for advanced index management, including the use of TIDB_INDEX_USAGE and sys.schema_unused_indexes for identifying unused or inefficient indexes, and invisible indexes for safe testing of index removal.
  • New Batch Processing Documentation: Introduced a new document detailing various batch processing features in TiDB, such as Pipelined DML, non-transactional DML, and the IMPORT INTO statement, along with their benefits and limitations.
  • Updated Auto-Increment and Auto-Random Behaviors: Refined documentation for AUTO_INCREMENT and AUTO_RANDOM attributes, including new guidance on clearing the auto-increment ID cache to prevent potential ID collisions in multi-instance deployments.
  • Expanded Developer Guides: Added a new C# sample application to the developer guides and updated existing guides with clearer instructions, connection details, and compatibility notes for various languages and ORMs.
  • Improved Security and Deployment Best Practices: Updated security configuration best practices, including firewall settings, TLS validation steps between components, and recommendations for managing system swap and SELinux during deployment.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/dispatch.yml
    • .github/workflows/link-fail-fast.yaml
    • .github/workflows/media.yml
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.

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 significant number of updates and refactoring across the documentation for the v8.5 release. Key changes include the introduction of new Table of Contents files, updates to existing ones, widespread use of new template variables for product naming, and the addition of several new guides and best practice documents. Many existing documents have been improved for clarity, accuracy, and consistency, with updated performance metrics, compatibility information, and configuration recommendations. I've found a few minor issues, such as typos and style guide inconsistencies, and one case of duplicated content that should be addressed. Overall, this is a very thorough and valuable update to the documentation.

![Calibrate by Hardware](/media/dashboard/dashboard-resource-manager-calibrate-by-hardware.png)

The **Total RU of user resource groups** represents the total amount of RU for all user resource groups, excluding the `default` resource group. If this value is less than the estimated capacity, the system triggers an alert. By default, the system allocates unlimited usage to the predefined `default` resource group. When all users belong to the `default` resource group, resources are allocated in the same way as when resource control is disabled.
The **Total RU of user resource groups** represents the total amount of RU for all user resource groups, excluding the `default` resource group. If this value is more than the estimated capacity, the system triggers an alert. By default, the system allocates unlimited usage to the predefined `default` resource group. When all users belong to the `default` resource group, resources are allocated in the same way as when resource control is disabled.

Choose a reason for hiding this comment

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

medium

This is a good correction. The alert should trigger when the total RU is more than the capacity, not less.

Comment on lines 101 to 103
#### Obsolete MVCC versions and excessive keys

A TiKV instance has much outdated data, which needs to be cleaned up for data scan. This impacts the processing speed.
If too many obsolete MVCC versions exist on TiKV, or if the retention time of historical MVCC data for GC is long, excessive MVCC versions can accumulate. Handling these unnecessary MVCC versions can affect scan performance.

Choose a reason for hiding this comment

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

low

The new heading and description are more detailed and technically accurate, which is a great improvement.

Comment on lines 2 to 8
title: Best Practices for Tuning TiKV Performance with Massive Regions
summary: TiKV performance tuning involves reducing the number of Regions and messages, increasing Raftstore concurrency, enabling Hibernate Region and Region Merge, adjusting Raft base tick interval, increasing TiKV instances, and adjusting Region size. Other issues include slow PD leader switching and outdated PD routing information.
aliases: ['/docs/dev/best-practices/massive-regions-best-practices/','/docs/dev/reference/best-practices/massive-regions/']
---

# Best Practices for TiKV Performance Tuning with Massive Regions
# Best Practices for Tuning TiKV Performance with Massive Regions

In TiDB, data is split into Regions, each storing data for a specific key range. These Regions are distributed among multiple TiKV instances. As data is written into a cluster, millions of Regions might be created. Too many Regions on a single TiKV instance can bring a heavy burden to the cluster and affect its performance.

Choose a reason for hiding this comment

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

low

The title change to 'Best Practices for Tuning TiKV Performance with Massive Regions' is more concise and improves readability.

- C#
- [C#](/develop/dev-guide-sample-application-cs.md)
- [WordPress](/tidb-cloud/dev-guide-wordpress.md)
- Serverless Driver ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) <!--TBD, ToDo: Not sure if we need to update the driver name-->

Choose a reason for hiding this comment

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

low

This file contains an internal <!--TBD, ToDo: ... --> comment. These should be removed before merging the documentation.


# Table of Contents

## GET STARTED

Choose a reason for hiding this comment

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

low

The style guide specifies using sentence case for headings (e.g., ## Configure the cluster). Headings like ## GET STARTED should be changed to ## Get started to align with the guide. This applies to other all-caps headings in this file as well.1

Suggested change
## GET STARTED
## Get started

Style Guide References

Footnotes

  1. Use sentence case for headings (e.g., ## Configure the cluster).

Comment on lines 2 to 8
title: Best Practices for Using UUIDs as Primary Keys
summary: UUIDs, when used as primary keys, offer benefits such as reduced network trips, support in most programming languages and databases, and protection against enumeration attacks. Storing UUIDs as binary in a `BINARY(16)` column is recommended. It's also advised to avoid setting the `swap_flag` with TiDB to prevent hotspots. MySQL compatibility is available for UUIDs.
---

# UUID Best Practices
# Best Practices for Using UUIDs as Primary Keys

UUIDs (Universally Unique Identifiers) are a popular alternative to auto-incrementing integers for primary keys in distributed databases. This document outlines the benefits of using UUIDs in TiDB, and offers best practices for storing and indexing them efficiently.

Choose a reason for hiding this comment

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

low

The new title 'Best Practices for Using UUIDs as Primary Keys' is more specific and improves clarity. The expanded introduction is also helpful.

Comment on lines 89 to 93
```

```
ERROR 1115 (42000): Unsupported character introducer: 'gbk'
```

Choose a reason for hiding this comment

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

low

This formatting change improves readability by putting the error message in its own code block.

- C#
- [C#](/develop/dev-guide-sample-application-cs.md)
- [WordPress](/tidb-cloud/dev-guide-wordpress.md)
- Serverless Driver ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) <!--TBD, ToDo: Not sure if we need to update the driver name-->

Choose a reason for hiding this comment

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

low

This file contains an internal <!--TBD, ToDo: ... --> comment. These should be removed before merging the documentation.

Comment on lines 2 to 8
title: Best Practices for DDL Execution in TiDB
summary: Learn about how DDL statements are implemented in TiDB, the online change process, and best practices.
---

# Execution Principles and Best Practices of DDL Statements
# Best Practices for DDL Execution in TiDB

This document provides an overview of the execution principles and best practices related to DDL statements in TiDB. The principles include the DDL Owner module and the online DDL change process.

Choose a reason for hiding this comment

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

low

The new title and introduction are clearer and more direct.

```

The example query above takes `1.03` seconds to execute, which is an ideal performance.
The example query above takes `1.03` seconds to execute, which is not ideal performance.

Choose a reason for hiding this comment

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

low

This is a good correction. The original text stated the performance was 'ideal', which was incorrect given the context of optimization. Changing it to 'not ideal' makes the document much clearer.

@Frank945946 Frank945946 changed the base branch from master to release-8.5 November 7, 2025 03:09
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 7, 2025
> **Note:**
>
> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential).
> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential). For [{{{ .premium }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#premium), modifying this parameter has no effect on index creation.
Copy link
Contributor

Choose a reason for hiding this comment

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

not read-only, it's not working for add-index, for other reorg jobs it still work

Replaced explicit TiDB Cloud Premium links with template variable {{{ .premium }}} and clarified that certain options are auto-tuned and cannot be modified by users. Updated support contact phrasing for consistency and accuracy.
Updated the documentation for the tidb_ddl_disk_quota variable to clarify its behavior across TiDB Cloud cluster tiers. Added custom content blocks for different plans and improved notes for the premium tier, including support contact information and consistent terminology.
@lilin90 lilin90 self-assigned this Nov 7, 2025
@lilin90 lilin90 added the translation/no-need No need to translate this PR. label Nov 7, 2025
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Nov 7, 2025
@lilin90 lilin90 added area/tidb-cloud This PR relates to the area of TiDB Cloud. for-cloud-release This PR is related to TiDB Cloud release. labels Nov 7, 2025
@lilin90 lilin90 changed the title Add limitations on import and index creation for TiDB X Premium premium: add limitations on import and index creation Nov 7, 2025
| `CLOUD_STORAGE_URI` | All file formats | Specifies the target address where encoded KV data for [Global Sort](/tidb-global-sort.md) is stored. When `CLOUD_STORAGE_URI` is not specified, `IMPORT INTO` determines whether to use Global Sort based on the value of the system variable [`tidb_cloud_storage_uri`](/system-variables.md#tidb_cloud_storage_uri-new-in-v740). If this system variable specifies a target storage address, `IMPORT INTO` uses this address for Global Sort. When `CLOUD_STORAGE_URI` is specified with a non-empty value, `IMPORT INTO` uses that value as the target storage address. When `CLOUD_STORAGE_URI` is specified with an empty value, local sorting is enforced. Currently, the target storage address only supports S3. For details about the URI configuration, see [Amazon S3 URI format](/external-storage-uri.md#amazon-s3-uri-format). When this feature is used, all TiDB nodes must have read and write access for the target S3 bucket, including at least these permissions: `s3:ListBucket`, `s3:GetObject`, `s3:DeleteObject`, `s3:PutObject`, `s3: AbortMultipartUpload`. |
| `DISABLE_PRECHECK` | All file formats and query results of `SELECT` | Setting this option disables pre-checks of non-critical items, such as checking whether there are CDC or PITR tasks. |

<CustomContent plan="premium">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent plan="premium">
<CustomContent platform="tidb-cloud" plan="premium">

>
> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential).

</CustomContent>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
</CustomContent>
</CustomContent>

- When Global Sort is disabled, only one TiDB node writes to TiKV at a time. In this case, the maximum write bandwidth per TiKV node is `100MiB`.
- When Global Sort is enabled, all 4 TiDB nodes can write to TiKV simultaneously. In this case, the maximum write bandwidth per TiKV node is `4 * 100MiB = 400MiB`.
<CustomContent plan="premium">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent plan="premium">
<CustomContent platform="tidb-cloud" plan="premium">

- Starting from v8.3.0, this parameter is supported at the SESSION level. Modifying the parameter at the GLOBAL level will not impact currently running DDL statements. It will only apply to DDLs submitted in new sessions.
- Starting from v8.5.0, you can modify this parameter for a running DDL job by executing `ADMIN ALTER DDL JOBS <job_id> THREAD = <new_thread_count>;`. Note that this operation is not supported for `ADD INDEX` DDL when [`tidb_enable_dist_task`](/system-variables.md#tidb_enable_dist_task-new-in-v710) is enabled. For details, see [`ADMIN ALTER DDL JOBS`](/sql-statements/sql-statement-admin-alter-ddl.md).
<CustomContent plan="premium">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent plan="premium">
<CustomContent platform="tidb-cloud" plan="premium">

SET GLOBAL tidb_cloud_storage_uri = 's3://my-bucket/test-data?role-arn=arn:aws:iam::888888888888:role/my-role'
```

<CustomContent plan="premium">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent plan="premium">
<CustomContent platform="tidb-cloud" plan="premium">

Comment on lines +68 to +69

</CustomContent>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
</CustomContent>

> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential).

</CustomContent>
<CustomContent platform="tidb-cloud" plan="premium">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent platform="tidb-cloud" plan="premium">
<CustomContent platform="tidb-cloud" plan="starter,essential,premium">

</CustomContent>
### tidb_ddl_reorg_worker_cnt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<CustomContent platform="tidb-cloud" plan="starter,essential,premium">

>
> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential).
> This variable is read-only for [{{{ .starter }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#starter) and [{{{ .essential }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#essential). For [{{{ .premium }}}](https://docs.pingcap.com/tidbcloud/select-cluster-tier#premium), modifying this parameter has no effect on index creation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
</CustomContent>

Co-authored-by: xixirangrang <hfxsd@hotmail.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Nov 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from lilin90. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

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

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

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

Labels

area/develop This PR relates to the area of TiDB App development. area/tidb-cloud This PR relates to the area of TiDB Cloud. contribution This PR is from a community contributor. for-cloud-release This PR is related to TiDB Cloud release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants