diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 1e0962c9506b3..e9f3c78478d22 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -1,118 +1,137 @@ -- [Docs Home](https://docs.pingcap.com/) -- About TiDB Cloud - - [What is TiDB Cloud](/tidb-cloud/tidb-cloud-intro.md) - - [Architecture](/tidb-cloud/tidb-cloud-intro.md#architecture) - - High Availability - - [Multi-AZ Deployments](/tidb-cloud/high-availability-with-multi-az.md) - - [High Availability in TiDB Cloud Serverless](/tidb-cloud/serverless-high-availability.md) +# Table of Contents + +## GET STARTED + +- Why TiDB Cloud + - [TiDB Cloud Introduction](/tidb-cloud/tidb-cloud-intro.md) - [MySQL Compatibility](/mysql-compatibility.md) - [Roadmap](/tidb-cloud/tidb-cloud-roadmap.md) -- Get Started - - [Try Out TiDB Cloud](/tidb-cloud/tidb-cloud-quickstart.md) +- Get Started with TiDB Cloud + - [Try Out TiDB Cloud Serverless](/tidb-cloud/tidb-cloud-quickstart.md) - [Try Out TiDB + AI](/tidb-cloud/vector-search-get-started-using-python.md) - [Try Out HTAP](/tidb-cloud/tidb-cloud-htap-quickstart.md) - [Try Out TiDB Cloud CLI](/tidb-cloud/get-started-with-cli.md) - [Perform a PoC](/tidb-cloud/tidb-cloud-poc.md) -- Develop Applications - - [Overview](/develop/dev-guide-overview.md) - - Quick Start - - [Build a TiDB Cloud Serverless Cluster](/develop/dev-guide-build-cluster-in-cloud.md) - - [CRUD SQL in TiDB](/develop/dev-guide-tidb-crud-sql.md) - - Connect to TiDB Cloud - - GUI Database Tools - - [JetBrains DataGrip](/develop/dev-guide-gui-datagrip.md) - - [DBeaver](/develop/dev-guide-gui-dbeaver.md) - - [VS Code](/develop/dev-guide-gui-vscode-sqltools.md) - - [MySQL Workbench](/develop/dev-guide-gui-mysql-workbench.md) - - [Navicat](/develop/dev-guide-gui-navicat.md) - - [Choose Driver or ORM](/develop/dev-guide-choose-driver-or-orm.md) - - BI - - [Looker Studio](/tidb-cloud/dev-guide-bi-looker-studio.md) - - Java - - [JDBC](/develop/dev-guide-sample-application-java-jdbc.md) - - [MyBatis](/develop/dev-guide-sample-application-java-mybatis.md) - - [Hibernate](/develop/dev-guide-sample-application-java-hibernate.md) - - [Spring Boot](/develop/dev-guide-sample-application-java-spring-boot.md) - - [Connection Pools and Connection Parameters](/develop/dev-guide-connection-parameters.md) - - Go - - [Go-MySQL-Driver](/develop/dev-guide-sample-application-golang-sql-driver.md) - - [GORM](/develop/dev-guide-sample-application-golang-gorm.md) - - Python - - [mysqlclient](/develop/dev-guide-sample-application-python-mysqlclient.md) - - [MySQL Connector/Python](/develop/dev-guide-sample-application-python-mysql-connector.md) - - [PyMySQL](/develop/dev-guide-sample-application-python-pymysql.md) - - [SQLAlchemy](/develop/dev-guide-sample-application-python-sqlalchemy.md) - - [peewee](/develop/dev-guide-sample-application-python-peewee.md) - - [Django](/develop/dev-guide-sample-application-python-django.md) - - Node.js - - [node-mysql2](/develop/dev-guide-sample-application-nodejs-mysql2.md) - - [mysql.js](/develop/dev-guide-sample-application-nodejs-mysqljs.md) - - [Prisma](/develop/dev-guide-sample-application-nodejs-prisma.md) - - [Sequelize](/develop/dev-guide-sample-application-nodejs-sequelize.md) - - [TypeORM](/develop/dev-guide-sample-application-nodejs-typeorm.md) - - [Next.js](/develop/dev-guide-sample-application-nextjs.md) - - [AWS Lambda](/develop/dev-guide-sample-application-aws-lambda.md) - - Ruby - - [mysql2](/develop/dev-guide-sample-application-ruby-mysql2.md) - - [Rails](/develop/dev-guide-sample-application-ruby-rails.md) - - [WordPress](/tidb-cloud/dev-guide-wordpress.md) - - Serverless Driver (Beta) - - [TiDB Cloud Serverless Driver](/tidb-cloud/serverless-driver.md) - - [Node.js Example](/tidb-cloud/serverless-driver-node-example.md) - - [Prisma Example](/tidb-cloud/serverless-driver-prisma-example.md) - - [Kysely Example](/tidb-cloud/serverless-driver-kysely-example.md) - - [Drizzle Example](/tidb-cloud/serverless-driver-drizzle-example.md) +- Key Concepts + - [Architecture](/tidb-cloud/architecture-concepts.md) + - [Database Schema](/tidb-cloud/database-schema-concepts.md) + - [Transactions](/tidb-cloud/transaction-concepts.md) + - [SQL](/tidb-cloud/sql-concepts.md) + - [AI Features](/tidb-cloud/ai-feature-concepts.md) + - [Data Service](/tidb-cloud/data-service-concepts.md) ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) + - [Scalability](/tidb-cloud/scalability-concepts.md) + - High Availability + - [Multi-AZ Deployments](/tidb-cloud/high-availability-with-multi-az.md) + - [High Availability in TiDB Cloud Serverless](/tidb-cloud/serverless-high-availability.md) + - [Monitoring](/tidb-cloud/monitoring-concepts.md) + - [Data Streaming](/tidb-cloud/data-streaming-concepts.md) + - [Backup & Restore](/tidb-cloud/backup-and-restore-concepts.md) + - [Security](/tidb-cloud/security-concepts.md) + +## DEVELOP + +- Development Quick Start + - [Developer Guide Overview](/develop/dev-guide-overview.md) + - [Build a TiDB Cloud Serverless Cluster](/develop/dev-guide-build-cluster-in-cloud.md) + - [CRUD SQL in TiDB](/develop/dev-guide-tidb-crud-sql.md) +- Connect to TiDB Cloud + - GUI Database Tools + - [JetBrains DataGrip](/develop/dev-guide-gui-datagrip.md) + - [DBeaver](/develop/dev-guide-gui-dbeaver.md) + - [VS Code](/develop/dev-guide-gui-vscode-sqltools.md) + - [MySQL Workbench](/develop/dev-guide-gui-mysql-workbench.md) + - [Navicat](/develop/dev-guide-gui-navicat.md) + - [Choose Driver or ORM](/develop/dev-guide-choose-driver-or-orm.md) + - BI + - [Looker Studio](/tidb-cloud/dev-guide-bi-looker-studio.md) + - Java + - [JDBC](/develop/dev-guide-sample-application-java-jdbc.md) + - [MyBatis](/develop/dev-guide-sample-application-java-mybatis.md) + - [Hibernate](/develop/dev-guide-sample-application-java-hibernate.md) + - [Spring Boot](/develop/dev-guide-sample-application-java-spring-boot.md) + - [Connection Pools and Connection Parameters](/develop/dev-guide-connection-parameters.md) + - Go + - [Go-MySQL-Driver](/develop/dev-guide-sample-application-golang-sql-driver.md) + - [GORM](/develop/dev-guide-sample-application-golang-gorm.md) + - Python + - [mysqlclient](/develop/dev-guide-sample-application-python-mysqlclient.md) + - [MySQL Connector/Python](/develop/dev-guide-sample-application-python-mysql-connector.md) + - [PyMySQL](/develop/dev-guide-sample-application-python-pymysql.md) + - [SQLAlchemy](/develop/dev-guide-sample-application-python-sqlalchemy.md) + - [peewee](/develop/dev-guide-sample-application-python-peewee.md) + - [Django](/develop/dev-guide-sample-application-python-django.md) + - Node.js + - [node-mysql2](/develop/dev-guide-sample-application-nodejs-mysql2.md) + - [mysql.js](/develop/dev-guide-sample-application-nodejs-mysqljs.md) + - [Prisma](/develop/dev-guide-sample-application-nodejs-prisma.md) + - [Sequelize](/develop/dev-guide-sample-application-nodejs-sequelize.md) + - [TypeORM](/develop/dev-guide-sample-application-nodejs-typeorm.md) + - [Next.js](/develop/dev-guide-sample-application-nextjs.md) + - [AWS Lambda](/develop/dev-guide-sample-application-aws-lambda.md) + - Ruby + - [mysql2](/develop/dev-guide-sample-application-ruby-mysql2.md) + - [Rails](/develop/dev-guide-sample-application-ruby-rails.md) + - [WordPress](/tidb-cloud/dev-guide-wordpress.md) + - Serverless Driver ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) + - [TiDB Cloud Serverless Driver](/tidb-cloud/serverless-driver.md) + - [Node.js Example](/tidb-cloud/serverless-driver-node-example.md) + - [Prisma Example](/tidb-cloud/serverless-driver-prisma-example.md) + - [Kysely Example](/tidb-cloud/serverless-driver-kysely-example.md) + - [Drizzle Example](/tidb-cloud/serverless-driver-drizzle-example.md) +- Development Reference + - Design Database Schema + - [Overview](/develop/dev-guide-schema-design-overview.md) + - [Create a Database](/develop/dev-guide-create-database.md) + - [Create a Table](/develop/dev-guide-create-table.md) + - [Create a Secondary Index](/develop/dev-guide-create-secondary-indexes.md) + - Write Data + - [Insert Data](/develop/dev-guide-insert-data.md) + - [Update Data](/develop/dev-guide-update-data.md) + - [Delete Data](/develop/dev-guide-delete-data.md) + - [Periodically Delete Expired Data Using TTL (Time to Live)](/time-to-live.md) + - [Prepared Statements](/develop/dev-guide-prepared-statement.md) + - Read Data + - [Query Data from a Single Table](/develop/dev-guide-get-data-from-single-table.md) + - [Multi-table Join Queries](/develop/dev-guide-join-tables.md) + - [Subquery](/develop/dev-guide-use-subqueries.md) + - [Paginate Results](/develop/dev-guide-paginate-results.md) + - [Views](/develop/dev-guide-use-views.md) + - [Temporary Tables](/develop/dev-guide-use-temporary-tables.md) + - [Common Table Expression](/develop/dev-guide-use-common-table-expression.md) + - Read Replica Data + - [Follower Read](/develop/dev-guide-use-follower-read.md) + - [Stale Read](/develop/dev-guide-use-stale-read.md) + - [HTAP Queries](/develop/dev-guide-hybrid-oltp-and-olap-queries.md) + - Transaction + - [Overview](/develop/dev-guide-transaction-overview.md) + - [Optimistic and Pessimistic Transactions](/develop/dev-guide-optimistic-and-pessimistic-transaction.md) + - [Transaction Restraints](/develop/dev-guide-transaction-restraints.md) + - [Handle Transaction Errors](/develop/dev-guide-transaction-troubleshoot.md) + - Optimize + - [Overview](/develop/dev-guide-optimize-sql-overview.md) + - [SQL Performance Tuning](/develop/dev-guide-optimize-sql.md) + - [Best Practices for Performance Tuning](/develop/dev-guide-optimize-sql-best-practices.md) + - [Best Practices for Indexing](/develop/dev-guide-index-best-practice.md) + - Other Optimization Methods + - [Avoid Implicit Type Conversions](/develop/dev-guide-implicit-type-conversion.md) + - [Unique Serial Number Generation](/develop/dev-guide-unique-serial-number-generation.md) + - Troubleshoot + - [SQL or Transaction Issues](/develop/dev-guide-troubleshoot-overview.md) + - [Unstable Result Set](/develop/dev-guide-unstable-result-set.md) + - [Timeouts](/develop/dev-guide-timeouts-in-tidb.md) + - Development Guidelines + - [Object Naming Convention](/develop/dev-guide-object-naming-guidelines.md) + - [SQL Development Specifications](/develop/dev-guide-sql-development-specification.md) + - [Bookshop Example Application](/develop/dev-guide-bookshop-schema-design.md) - Third-Party Support - [Third-Party Tools Supported by TiDB](/develop/dev-guide-third-party-support.md) - [Known Incompatibility Issues with Third-Party Tools](/develop/dev-guide-third-party-tools-compatibility.md) - - Development Reference - - Design Database Schema - - [Overview](/develop/dev-guide-schema-design-overview.md) - - [Create a Database](/develop/dev-guide-create-database.md) - - [Create a Table](/develop/dev-guide-create-table.md) - - [Create a Secondary Index](/develop/dev-guide-create-secondary-indexes.md) - - Write Data - - [Insert Data](/develop/dev-guide-insert-data.md) - - [Update Data](/develop/dev-guide-update-data.md) - - [Delete Data](/develop/dev-guide-delete-data.md) - - [Periodically Delete Expired Data Using TTL (Time to Live)](/time-to-live.md) - - [Prepared Statements](/develop/dev-guide-prepared-statement.md) - - Read Data - - [Query Data from a Single Table](/develop/dev-guide-get-data-from-single-table.md) - - [Multi-table Join Queries](/develop/dev-guide-join-tables.md) - - [Subquery](/develop/dev-guide-use-subqueries.md) - - [Paginate Results](/develop/dev-guide-paginate-results.md) - - [Views](/develop/dev-guide-use-views.md) - - [Temporary Tables](/develop/dev-guide-use-temporary-tables.md) - - [Common Table Expression](/develop/dev-guide-use-common-table-expression.md) - - Read Replica Data - - [Follower Read](/develop/dev-guide-use-follower-read.md) - - [Stale Read](/develop/dev-guide-use-stale-read.md) - - [HTAP Queries](/develop/dev-guide-hybrid-oltp-and-olap-queries.md) - - Transaction - - [Overview](/develop/dev-guide-transaction-overview.md) - - [Optimistic and Pessimistic Transactions](/develop/dev-guide-optimistic-and-pessimistic-transaction.md) - - [Transaction Restraints](/develop/dev-guide-transaction-restraints.md) - - [Handle Transaction Errors](/develop/dev-guide-transaction-troubleshoot.md) - - Optimize - - [Overview](/develop/dev-guide-optimize-sql-overview.md) - - [SQL Performance Tuning](/develop/dev-guide-optimize-sql.md) - - [Best Practices for Performance Tuning](/develop/dev-guide-optimize-sql-best-practices.md) - - [Best Practices for Indexing](/develop/dev-guide-index-best-practice.md) - - Other Optimization Methods - - [Avoid Implicit Type Conversions](/develop/dev-guide-implicit-type-conversion.md) - - [Unique Serial Number Generation](/develop/dev-guide-unique-serial-number-generation.md) - - Troubleshoot - - [SQL or Transaction Issues](/develop/dev-guide-troubleshoot-overview.md) - - [Unstable Result Set](/develop/dev-guide-unstable-result-set.md) - - [Timeouts](/develop/dev-guide-timeouts-in-tidb.md) - - Development Guidelines - - [Object Naming Convention](/develop/dev-guide-object-naming-guidelines.md) - - [SQL Development Specifications](/develop/dev-guide-sql-development-specification.md) - - [Bookshop Example Application](/develop/dev-guide-bookshop-schema-design.md) + +## GUIDES + - Manage Cluster - Plan Your Cluster - [Select Your Cluster Tier](/tidb-cloud/select-cluster-tier.md) @@ -124,7 +143,7 @@ - [Connection Overview](/tidb-cloud/connect-to-tidb-cluster-serverless.md) - [Connect via Public Endpoint](/tidb-cloud/connect-via-standard-connection-serverless.md) - [Connect via Private Endpoint](/tidb-cloud/set-up-private-endpoint-connections-serverless.md) - - Branch (Beta) + - Branch ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - [Overview](/tidb-cloud/branch-overview.md) - [Manage Branches](/tidb-cloud/branch-manage.md) - [GitHub Integration](/tidb-cloud/branch-github-integration.md) @@ -160,12 +179,12 @@ - [Built-in Metrics](/tidb-cloud/built-in-monitoring.md) - [Built-in Alerting](/tidb-cloud/monitor-built-in-alerting.md) - [Cluster Events](/tidb-cloud/tidb-cloud-events.md) - - [Third-Party Metrics Integrations (Beta)](/tidb-cloud/third-party-monitoring-integrations.md) + - [Third-Party Metrics Integrations](/tidb-cloud/third-party-monitoring-integrations.md) ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - Tune Performance - [Overview](/tidb-cloud/tidb-cloud-tune-performance-overview.md) - Analyze Performance - [Use the Diagnosis Tab](/tidb-cloud/tune-performance.md) - - [Use Index Insight (Beta)](/tidb-cloud/index-insight.md) + - [Use Index Insight](/tidb-cloud/index-insight.md) ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - [Use Statement Summary Tables](/statement-summary-tables.md) - SQL Tuning - [Overview](/tidb-cloud/tidb-cloud-sql-tuning-overview.md) @@ -248,9 +267,9 @@ - [Precheck Errors, Migration Errors, and Alerts for Data Migration](/tidb-cloud/tidb-cloud-dm-precheck-and-troubleshooting.md) - [Connect AWS DMS to TiDB Cloud clusters](/tidb-cloud/tidb-cloud-connect-aws-dms.md) - Explore Data - - [Chat2Query (Beta) in SQL Editor](/tidb-cloud/explore-data-with-chat2query.md) + - [Chat2Query in SQL Editor](/tidb-cloud/explore-data-with-chat2query.md) ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - [SQL Proxy Account](/tidb-cloud/sql-proxy-account.md) -- Vector Search (Beta) +- Vector Search ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - [Overview](/tidb-cloud/vector-search-overview.md) - Get Started - [Get Started with SQL](/tidb-cloud/vector-search-get-started-using-sql.md) @@ -273,7 +292,7 @@ - [Improve Performance](/tidb-cloud/vector-search-improve-performance.md) - [Limitations](/tidb-cloud/vector-search-limitations.md) - [Changelogs](/tidb-cloud/vector-search-changelogs.md) -- Data Service (Beta) +- Data Service ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) - [Overview](/tidb-cloud/data-service-overview.md) - [Get Started](/tidb-cloud/data-service-get-started.md) - Chat2Query API @@ -340,19 +359,6 @@ - [Billing for Data Migration](/tidb-cloud/tidb-cloud-billing-dm.md) - [Billing for Recovery Groups](/tidb-cloud/tidb-cloud-billing-recovery-group.md) - [Manage Budgets](/tidb-cloud/tidb-cloud-budget.md) -- TiDB Cloud Partner Web Console - - [TiDB Cloud Partners](/tidb-cloud/tidb-cloud-partners.md) - - [MSP Customer](/tidb-cloud/managed-service-provider-customer.md) - - [Reseller's Customer](/tidb-cloud/cppo-customer.md) -- API - - [API Overview](/tidb-cloud/api-overview.md) - - API Reference - - v1beta1 - - [Billing](https://docs.pingcap.com/tidbcloud/api/v1beta1/billing) - - [Data Service](https://docs.pingcap.com/tidbcloud/api/v1beta1/dataservice) - - [IAM](https://docs.pingcap.com/tidbcloud/api/v1beta1/iam) - - [MSP (Deprecated)](https://docs.pingcap.com/tidbcloud/api/v1beta1/msp) - - [v1beta](https://docs.pingcap.com/tidbcloud/api/v1beta) - Integrations - [Airbyte](/tidb-cloud/integrate-tidbcloud-with-airbyte.md) - [Amazon AppFlow](/develop/dev-guide-aws-appflow-integration.md) @@ -374,20 +380,383 @@ - [Use Import Resource](/tidb-cloud/terraform-use-import-resource.md) - [Vercel](/tidb-cloud/integrate-tidbcloud-with-vercel.md) - [Zapier](/tidb-cloud/integrate-tidbcloud-with-zapier.md) -- Reference + +## REFERENCE + +- SQL Reference + - [Explore SQL with TiDB](/basic-sql-operations.md) + - SQL Language Structure and Syntax + - Attributes + - [AUTO_INCREMENT](/auto-increment.md) + - [AUTO_RANDOM](/auto-random.md) + - [SHARD_ROW_ID_BITS](/shard-row-id-bits.md) + - [Literal Values](/literal-values.md) + - [Schema Object Names](/schema-object-names.md) + - [Keywords and Reserved Words](/keywords.md) + - [User-Defined Variables](/user-defined-variables.md) + - [Expression Syntax](/expression-syntax.md) + - [Comment Syntax](/comment-syntax.md) + - SQL Statements + - [Overview](/sql-statements/sql-statement-overview.md) + - [`ADMIN`](/sql-statements/sql-statement-admin.md) + - [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) + - [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) + - [`ADMIN CHECK [TABLE|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) + - [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) + - [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) + - [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) + - [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) + - [`ADMIN SHOW DDL [JOBS|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) + - [`ALTER DATABASE`](/sql-statements/sql-statement-alter-database.md) + - [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) + - [`ALTER PLACEMENT POLICY`](/sql-statements/sql-statement-alter-placement-policy.md) + - [`ALTER RANGE`](/sql-statements/sql-statement-alter-range.md) + - [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) + - [`ALTER SEQUENCE`](/sql-statements/sql-statement-alter-sequence.md) + - `ALTER TABLE` + - [Overview](/sql-statements/sql-statement-alter-table.md) + - [`ADD COLUMN`](/sql-statements/sql-statement-add-column.md) + - [`ADD INDEX`](/sql-statements/sql-statement-add-index.md) + - [`ALTER INDEX`](/sql-statements/sql-statement-alter-index.md) + - [`CHANGE COLUMN`](/sql-statements/sql-statement-change-column.md) + - [`COMPACT`](/sql-statements/sql-statement-alter-table-compact.md) + - [`DROP COLUMN`](/sql-statements/sql-statement-drop-column.md) + - [`DROP INDEX`](/sql-statements/sql-statement-drop-index.md) + - [`MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md) + - [`RENAME INDEX`](/sql-statements/sql-statement-rename-index.md) + - [`ALTER USER`](/sql-statements/sql-statement-alter-user.md) + - [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) + - [`BACKUP`](/sql-statements/sql-statement-backup.md) + - [`BATCH`](/sql-statements/sql-statement-batch.md) + - [`BEGIN`](/sql-statements/sql-statement-begin.md) + - [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) + - [`COMMIT`](/sql-statements/sql-statement-commit.md) + - [`CREATE [GLOBAL|SESSION] BINDING`](/sql-statements/sql-statement-create-binding.md) + - [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) + - [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md) + - [`CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-create-placement-policy.md) + - [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) + - [`CREATE ROLE`](/sql-statements/sql-statement-create-role.md) + - [`CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) + - [`CREATE TABLE LIKE`](/sql-statements/sql-statement-create-table-like.md) + - [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) + - [`CREATE USER`](/sql-statements/sql-statement-create-user.md) + - [`CREATE VIEW`](/sql-statements/sql-statement-create-view.md) + - [`DEALLOCATE`](/sql-statements/sql-statement-deallocate.md) + - [`DELETE`](/sql-statements/sql-statement-delete.md) + - [`DESC`](/sql-statements/sql-statement-desc.md) + - [`DESCRIBE`](/sql-statements/sql-statement-describe.md) + - [`DO`](/sql-statements/sql-statement-do.md) + - [`DROP [GLOBAL|SESSION] BINDING`](/sql-statements/sql-statement-drop-binding.md) + - [`DROP DATABASE`](/sql-statements/sql-statement-drop-database.md) + - [`DROP PLACEMENT POLICY`](/sql-statements/sql-statement-drop-placement-policy.md) + - [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) + - [`DROP ROLE`](/sql-statements/sql-statement-drop-role.md) + - [`DROP SEQUENCE`](/sql-statements/sql-statement-drop-sequence.md) + - [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) + - [`DROP TABLE`](/sql-statements/sql-statement-drop-table.md) + - [`DROP USER`](/sql-statements/sql-statement-drop-user.md) + - [`DROP VIEW`](/sql-statements/sql-statement-drop-view.md) + - [`EXECUTE`](/sql-statements/sql-statement-execute.md) + - [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) + - [`EXPLAIN`](/sql-statements/sql-statement-explain.md) + - [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) + - [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) + - [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) + - [`FLUSH PRIVILEGES`](/sql-statements/sql-statement-flush-privileges.md) + - [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) + - [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) + - [`GRANT `](/sql-statements/sql-statement-grant-privileges.md) + - [`GRANT `](/sql-statements/sql-statement-grant-role.md) + - [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) + - [`INSERT`](/sql-statements/sql-statement-insert.md) + - [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md) + - [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) + - [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) + - [`LOCK STATS`](/sql-statements/sql-statement-lock-stats.md) + - [`LOCK TABLES` and `UNLOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) + - [`PREPARE`](/sql-statements/sql-statement-prepare.md) + - [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) + - [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) + - [`RENAME TABLE`](/sql-statements/sql-statement-rename-table.md) + - [`RENAME USER`](/sql-statements/sql-statement-rename-user.md) + - [`REPLACE`](/sql-statements/sql-statement-replace.md) + - [`RESTORE`](/sql-statements/sql-statement-restore.md) + - [`REVOKE `](/sql-statements/sql-statement-revoke-privileges.md) + - [`REVOKE `](/sql-statements/sql-statement-revoke-role.md) + - [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) + - [`SAVEPOINT`](/sql-statements/sql-statement-savepoint.md) + - [`SELECT`](/sql-statements/sql-statement-select.md) + - [`SET DEFAULT ROLE`](/sql-statements/sql-statement-set-default-role.md) + - [`SET [NAMES|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) + - [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) + - [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) + - [`SET ROLE`](/sql-statements/sql-statement-set-role.md) + - [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) + - [`SET [GLOBAL|SESSION] `](/sql-statements/sql-statement-set-variable.md) + - [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) + - [`SHOW [BACKUPS|RESTORES]`](/sql-statements/sql-statement-show-backups.md) + - [`SHOW [GLOBAL|SESSION] BINDINGS`](/sql-statements/sql-statement-show-bindings.md) + - [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) + - [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) + - [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) + - [`SHOW COLUMN_STATS_USAGE`](/sql-statements/sql-statement-show-column-stats-usage.md) + - [`SHOW COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) + - [`SHOW CREATE DATABASE`](/sql-statements/sql-statement-show-create-database.md) + - [`SHOW CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-show-create-placement-policy.md) + - [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) + - [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) + - [`SHOW CREATE TABLE`](/sql-statements/sql-statement-show-create-table.md) + - [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) + - [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) + - [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) + - [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) + - [`SHOW FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md) + - [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) + - [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) + - [`SHOW INDEXES [FROM|IN]`](/sql-statements/sql-statement-show-indexes.md) + - [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) + - [`SHOW PLACEMENT`](/sql-statements/sql-statement-show-placement.md) + - [`SHOW PLACEMENT FOR`](/sql-statements/sql-statement-show-placement-for.md) + - [`SHOW PLACEMENT LABELS`](/sql-statements/sql-statement-show-placement-labels.md) + - [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) + - [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) + - [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) + - [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) + - [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) + - [`SHOW STATS_BUCKETS`](/sql-statements/sql-statement-show-stats-buckets.md) + - [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) + - [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) + - [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) + - [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) + - [`SHOW STATS_TOPN`](/sql-statements/sql-statement-show-stats-topn.md) + - [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) + - [`SHOW TABLE NEXT_ROW_ID`](/sql-statements/sql-statement-show-table-next-rowid.md) + - [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) + - [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) + - [`SHOW TABLES`](/sql-statements/sql-statement-show-tables.md) + - [`SHOW [GLOBAL|SESSION] VARIABLES`](/sql-statements/sql-statement-show-variables.md) + - [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) + - [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) + - [`START TRANSACTION`](/sql-statements/sql-statement-start-transaction.md) + - [`TABLE`](/sql-statements/sql-statement-table.md) + - [`TRACE`](/sql-statements/sql-statement-trace.md) + - [`TRUNCATE`](/sql-statements/sql-statement-truncate.md) + - [`UNLOCK STATS`](/sql-statements/sql-statement-unlock-stats.md) + - [`UPDATE`](/sql-statements/sql-statement-update.md) + - [`USE`](/sql-statements/sql-statement-use.md) + - [`WITH`](/sql-statements/sql-statement-with.md) + - Data Types + - [Overview](/data-type-overview.md) + - [Default Values](/data-type-default-values.md) + - [Numeric Types](/data-type-numeric.md) + - [Date and Time Types](/data-type-date-and-time.md) + - [String Types](/data-type-string.md) + - [JSON Type](/data-type-json.md) + - Functions and Operators + - [Overview](/functions-and-operators/functions-and-operators-overview.md) + - [Type Conversion in Expression Evaluation](/functions-and-operators/type-conversion-in-expression-evaluation.md) + - [Operators](/functions-and-operators/operators.md) + - [Control Flow Functions](/functions-and-operators/control-flow-functions.md) + - [String Functions](/functions-and-operators/string-functions.md) + - [Numeric Functions and Operators](/functions-and-operators/numeric-functions-and-operators.md) + - [Date and Time Functions](/functions-and-operators/date-and-time-functions.md) + - [Bit Functions and Operators](/functions-and-operators/bit-functions-and-operators.md) + - [Cast Functions and Operators](/functions-and-operators/cast-functions-and-operators.md) + - [Encryption and Compression Functions](/functions-and-operators/encryption-and-compression-functions.md) + - [Locking Functions](/functions-and-operators/locking-functions.md) + - [Information Functions](/functions-and-operators/information-functions.md) + - JSON Functions + - [Overview](/functions-and-operators/json-functions.md) + - [Functions That Create JSON](/functions-and-operators/json-functions/json-functions-create.md) + - [Functions That Search JSON](/functions-and-operators/json-functions/json-functions-search.md) + - [Functions That Modify JSON](/functions-and-operators/json-functions/json-functions-modify.md) + - [Functions That Return JSON](/functions-and-operators/json-functions/json-functions-return.md) + - [JSON Utility Functions](/functions-and-operators/json-functions/json-functions-utility.md) + - [Functions That Aggregate JSON](/functions-and-operators/json-functions/json-functions-aggregate.md) + - [Aggregate (GROUP BY) Functions](/functions-and-operators/aggregate-group-by-functions.md) + - [GROUP BY Modifiers](/functions-and-operators/group-by-modifier.md) + - [Window Functions](/functions-and-operators/window-functions.md) + - [Miscellaneous Functions](/functions-and-operators/miscellaneous-functions.md) + - [Precision Math](/functions-and-operators/precision-math.md) + - [Set Operations](/functions-and-operators/set-operators.md) + - [Sequence Functions](/functions-and-operators/sequence-functions.md) + - [List of Expressions for Pushdown](/functions-and-operators/expressions-pushed-down.md) + - [TiDB Specific Functions](/functions-and-operators/tidb-functions.md) + - [Clustered Indexes](/clustered-indexes.md) + - [Constraints](/constraints.md) + - [Generated Columns](/generated-columns.md) + - [SQL Mode](/sql-mode.md) + - [Table Attributes](/table-attributes.md) + - Transactions + - [Overview](/transaction-overview.md) + - [Isolation Levels](/transaction-isolation-levels.md) + - [Optimistic Transactions](/optimistic-transaction.md) + - [Pessimistic Transactions](/pessimistic-transaction.md) + - [Non-Transactional DML Statements](/non-transactional-dml.md) + - [Views](/views.md) + - [Partitioning](/partitioned-table.md) + - [Temporary Tables](/temporary-tables.md) + - [Cached Tables](/cached-tables.md) + - [FOREIGN KEY Constraints](/foreign-key.md) + - Character Set and Collation + - [Overview](/character-set-and-collation.md) + - [GBK](/character-set-gbk.md) + - Read Historical Data + - Use Stale Read (Recommended) + - [Usage Scenarios of Stale Read](/stale-read.md) + - [Perform Stale Read Using `As OF TIMESTAMP`](/as-of-timestamp.md) + - [Perform Stale Read Using `tidb_read_staleness`](/tidb-read-staleness.md) + - [Perform Stale Read Using `tidb_external_ts`](/tidb-external-ts.md) + - [Use the `tidb_snapshot` System Variable](/read-historical-data.md) + - [Placement Rules in SQL](/placement-rules-in-sql.md) + - System Tables + - `mysql` Schema + - [Overview](/mysql-schema/mysql-schema.md) + - [`user`](/mysql-schema/mysql-schema-user.md) + - INFORMATION_SCHEMA + - [Overview](/information-schema/information-schema.md) + - [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) + - [`CHECK_CONSTRAINTS`](/information-schema/information-schema-check-constraints.md) + - [`CLIENT_ERRORS_SUMMARY_BY_HOST`](/information-schema/client-errors-summary-by-host.md) + - [`CLIENT_ERRORS_SUMMARY_BY_USER`](/information-schema/client-errors-summary-by-user.md) + - [`CLIENT_ERRORS_SUMMARY_GLOBAL`](/information-schema/client-errors-summary-global.md) + - [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) + - [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) + - [`COLLATIONS`](/information-schema/information-schema-collations.md) + - [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) + - [`COLUMNS`](/information-schema/information-schema-columns.md) + - [`DATA_LOCK_WAITS`](/information-schema/information-schema-data-lock-waits.md) + - [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) + - [`DEADLOCKS`](/information-schema/information-schema-deadlocks.md) + - [`ENGINES`](/information-schema/information-schema-engines.md) + - [`KEYWORDS`](/information-schema/information-schema-keywords.md) + - [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) + - [`MEMORY_USAGE`](/information-schema/information-schema-memory-usage.md) + - [`MEMORY_USAGE_OPS_HISTORY`](/information-schema/information-schema-memory-usage-ops-history.md) + - [`PARTITIONS`](/information-schema/information-schema-partitions.md) + - [`PLACEMENT_POLICIES`](/information-schema/information-schema-placement-policies.md) + - [`PROCESSLIST`](/information-schema/information-schema-processlist.md) + - [`REFERENTIAL_CONSTRAINTS`](/information-schema/information-schema-referential-constraints.md) + - [`RESOURCE_GROUPS`](/information-schema/information-schema-resource-groups.md) + - [`RUNAWAY_WATCHES`](/information-schema/information-schema-runaway-watches.md) + - [`SCHEMATA`](/information-schema/information-schema-schemata.md) + - [`SEQUENCES`](/information-schema/information-schema-sequences.md) + - [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) + - [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) + - [`STATISTICS`](/information-schema/information-schema-statistics.md) + - [`TABLES`](/information-schema/information-schema-tables.md) + - [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) + - [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) + - [`TIDB_CHECK_CONSTRAINTS`](/information-schema/information-schema-tidb-check-constraints.md) + - [`TIDB_HOT_REGIONS_HISTORY`](/information-schema/information-schema-tidb-hot-regions-history.md) + - [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) + - [`TIDB_INDEX_USAGE`](/information-schema/information-schema-tidb-index-usage.md) + - [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) + - [`TIDB_TRX`](/information-schema/information-schema-tidb-trx.md) + - [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) + - [`TIFLASH_SEGMENTS`](/information-schema/information-schema-tiflash-segments.md) + - [`TIFLASH_TABLES`](/information-schema/information-schema-tiflash-tables.md) + - [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) + - [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) + - [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) + - [`USER_ATTRIBUTES`](/information-schema/information-schema-user-attributes.md) + - [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) + - [`VARIABLES_INFO`](/information-schema/information-schema-variables-info.md) + - [`VIEWS`](/information-schema/information-schema-views.md) + - PERFORMANCE_SCHEMA + - [Overview](/performance-schema/performance-schema.md) + - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) + - SYS + - [Overview](/sys-schema/sys-schema.md) + - [`schema_unused_indexes`](/sys-schema/sys-schema-unused-indexes.md) + - [Metadata Lock](/metadata-lock.md) + - [Use UUIDs](/best-practices/uuid.md) + - [TiDB Accelerated Table Creation](/accelerated-table-creation.md) +- API Reference ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) + - [Overview](/tidb-cloud/api-overview.md) + - v1beta1 + - [Billing](https://docs.pingcap.com/tidbcloud/api/v1beta1/billing) + - [Data Service](https://docs.pingcap.com/tidbcloud/api/v1beta1/dataservice) + - [IAM](https://docs.pingcap.com/tidbcloud/api/v1beta1/iam) + - [MSP (Deprecated)](https://docs.pingcap.com/tidbcloud/api/v1beta1/msp) + - [v1beta](https://docs.pingcap.com/tidbcloud/api/v1beta) +- CLI Reference ![BETA](/media/tidb-cloud/blank_transparent_placeholder.png) + - [Overview](/tidb-cloud/cli-reference.md) + - auth + - [login](/tidb-cloud/ticloud-auth-login.md) + - [logout](/tidb-cloud/ticloud-auth-logout.md) + - [whoami](/tidb-cloud/ticloud-auth-whoami.md) + - serverless + - [create](/tidb-cloud/ticloud-cluster-create.md) + - [delete](/tidb-cloud/ticloud-cluster-delete.md) + - [describe](/tidb-cloud/ticloud-cluster-describe.md) + - [list](/tidb-cloud/ticloud-cluster-list.md) + - [update](/tidb-cloud/ticloud-serverless-update.md) + - [spending-limit](/tidb-cloud/ticloud-serverless-spending-limit.md) + - [region](/tidb-cloud/ticloud-serverless-region.md) + - [shell](/tidb-cloud/ticloud-serverless-shell.md) + - branch + - [create](/tidb-cloud/ticloud-branch-create.md) + - [delete](/tidb-cloud/ticloud-branch-delete.md) + - [describe](/tidb-cloud/ticloud-branch-describe.md) + - [list](/tidb-cloud/ticloud-branch-list.md) + - [shell](/tidb-cloud/ticloud-branch-shell.md) + - import + - [cancel](/tidb-cloud/ticloud-import-cancel.md) + - [describe](/tidb-cloud/ticloud-import-describe.md) + - [list](/tidb-cloud/ticloud-import-list.md) + - [start](/tidb-cloud/ticloud-import-start.md) + - export + - [create](/tidb-cloud/ticloud-serverless-export-create.md) + - [describe](/tidb-cloud/ticloud-serverless-export-describe.md) + - [list](/tidb-cloud/ticloud-serverless-export-list.md) + - [cancel](/tidb-cloud/ticloud-serverless-export-cancel.md) + - [download](/tidb-cloud/ticloud-serverless-export-download.md) + - sql-user + - [create](/tidb-cloud/ticloud-serverless-sql-user-create.md) + - [delete](/tidb-cloud/ticloud-serverless-sql-user-delete.md) + - [list](/tidb-cloud/ticloud-serverless-sql-user-list.md) + - [update](/tidb-cloud/ticloud-serverless-sql-user-update.md) + - [ai](/tidb-cloud/ticloud-ai.md) + - [completion](/tidb-cloud/ticloud-completion.md) + - config + - [create](/tidb-cloud/ticloud-config-create.md) + - [delete](/tidb-cloud/ticloud-config-delete.md) + - [describe](/tidb-cloud/ticloud-config-describe.md) + - [edit](/tidb-cloud/ticloud-config-edit.md) + - [list](/tidb-cloud/ticloud-config-list.md) + - [set](/tidb-cloud/ticloud-config-set.md) + - [use](/tidb-cloud/ticloud-config-use.md) + - project + - [list](/tidb-cloud/ticloud-project-list.md) + - [upgrade](/tidb-cloud/ticloud-upgrade.md) + - [help](/tidb-cloud/ticloud-help.md) +- General Reference - TiDB Cluster Architecture - [Overview](/tidb-architecture.md) - [Storage](/tidb-storage.md) - [Computing](/tidb-computing.md) - [Scheduling](/tidb-scheduling.md) - [TSO](/tso.md) + - Storage Engines + - TiKV + - [TiKV Overview](/tikv-overview.md) + - [RocksDB Overview](/storage-engine/rocksdb-overview.md) + - TiFlash + - [TiFlash Overview](/tiflash/tiflash-overview.md) + - [Spill to Disk](/tiflash/tiflash-spill-disk.md) + - TiDB Cloud Partner Web Console + - [TiDB Cloud Partners](/tidb-cloud/tidb-cloud-partners.md) + - [MSP Customer](/tidb-cloud/managed-service-provider-customer.md) + - [Reseller's Customer](/tidb-cloud/cppo-customer.md) + - TiDB Distributed eXecution Framework (DXF) + - [Introduction](/tidb-distributed-execution-framework.md) + - [TiDB Global Sort](/tidb-global-sort.md) - [TiDB Cloud Dedicated Limitations and Quotas](/tidb-cloud/limitations-and-quotas.md) - [TiDB Cloud Serverless Limitations](/tidb-cloud/serverless-limitations.md) - [Limited SQL Features on TiDB Cloud](/tidb-cloud/limited-sql-features.md) - [TiDB Limitations](/tidb-limitations.md) - - TiDB Distributed eXecution Framework (DXF) - - [Introduction](/tidb-distributed-execution-framework.md) - - [TiDB Global Sort](/tidb-global-sort.md) - Benchmarks - TiDB v8.5 - [Performance Highlights](/tidb-cloud/v8.5-performance-highlights.md) @@ -405,357 +774,15 @@ - TiDB v6.5 - [TPC-C Performance Test Report](/tidb-cloud/v6.5-performance-benchmarking-with-tpcc.md) - [Sysbench Performance Test Report](/tidb-cloud/v6.5-performance-benchmarking-with-sysbench.md) - - SQL - - [Explore SQL with TiDB](/basic-sql-operations.md) - - SQL Language Structure and Syntax - - Attributes - - [AUTO_INCREMENT](/auto-increment.md) - - [AUTO_RANDOM](/auto-random.md) - - [SHARD_ROW_ID_BITS](/shard-row-id-bits.md) - - [Literal Values](/literal-values.md) - - [Schema Object Names](/schema-object-names.md) - - [Keywords and Reserved Words](/keywords.md) - - [User-Defined Variables](/user-defined-variables.md) - - [Expression Syntax](/expression-syntax.md) - - [Comment Syntax](/comment-syntax.md) - - SQL Statements - - [Overview](/sql-statements/sql-statement-overview.md) - - [`ADMIN`](/sql-statements/sql-statement-admin.md) - - [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) - - [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) - - [`ADMIN CHECK [TABLE|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) - - [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) - - [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) - - [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) - - [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) - - [`ADMIN SHOW DDL [JOBS|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) - - [`ALTER DATABASE`](/sql-statements/sql-statement-alter-database.md) - - [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) - - [`ALTER PLACEMENT POLICY`](/sql-statements/sql-statement-alter-placement-policy.md) - - [`ALTER RANGE`](/sql-statements/sql-statement-alter-range.md) - - [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) - - [`ALTER SEQUENCE`](/sql-statements/sql-statement-alter-sequence.md) - - `ALTER TABLE` - - [Overview](/sql-statements/sql-statement-alter-table.md) - - [`ADD COLUMN`](/sql-statements/sql-statement-add-column.md) - - [`ADD INDEX`](/sql-statements/sql-statement-add-index.md) - - [`ALTER INDEX`](/sql-statements/sql-statement-alter-index.md) - - [`CHANGE COLUMN`](/sql-statements/sql-statement-change-column.md) - - [`COMPACT`](/sql-statements/sql-statement-alter-table-compact.md) - - [`DROP COLUMN`](/sql-statements/sql-statement-drop-column.md) - - [`DROP INDEX`](/sql-statements/sql-statement-drop-index.md) - - [`MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md) - - [`RENAME INDEX`](/sql-statements/sql-statement-rename-index.md) - - [`ALTER USER`](/sql-statements/sql-statement-alter-user.md) - - [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) - - [`BACKUP`](/sql-statements/sql-statement-backup.md) - - [`BATCH`](/sql-statements/sql-statement-batch.md) - - [`BEGIN`](/sql-statements/sql-statement-begin.md) - - [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) - - [`COMMIT`](/sql-statements/sql-statement-commit.md) - - [`CREATE [GLOBAL|SESSION] BINDING`](/sql-statements/sql-statement-create-binding.md) - - [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) - - [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md) - - [`CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-create-placement-policy.md) - - [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) - - [`CREATE ROLE`](/sql-statements/sql-statement-create-role.md) - - [`CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) - - [`CREATE TABLE LIKE`](/sql-statements/sql-statement-create-table-like.md) - - [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) - - [`CREATE USER`](/sql-statements/sql-statement-create-user.md) - - [`CREATE VIEW`](/sql-statements/sql-statement-create-view.md) - - [`DEALLOCATE`](/sql-statements/sql-statement-deallocate.md) - - [`DELETE`](/sql-statements/sql-statement-delete.md) - - [`DESC`](/sql-statements/sql-statement-desc.md) - - [`DESCRIBE`](/sql-statements/sql-statement-describe.md) - - [`DO`](/sql-statements/sql-statement-do.md) - - [`DROP [GLOBAL|SESSION] BINDING`](/sql-statements/sql-statement-drop-binding.md) - - [`DROP DATABASE`](/sql-statements/sql-statement-drop-database.md) - - [`DROP PLACEMENT POLICY`](/sql-statements/sql-statement-drop-placement-policy.md) - - [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) - - [`DROP ROLE`](/sql-statements/sql-statement-drop-role.md) - - [`DROP SEQUENCE`](/sql-statements/sql-statement-drop-sequence.md) - - [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) - - [`DROP TABLE`](/sql-statements/sql-statement-drop-table.md) - - [`DROP USER`](/sql-statements/sql-statement-drop-user.md) - - [`DROP VIEW`](/sql-statements/sql-statement-drop-view.md) - - [`EXECUTE`](/sql-statements/sql-statement-execute.md) - - [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) - - [`EXPLAIN`](/sql-statements/sql-statement-explain.md) - - [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) - - [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) - - [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) - - [`FLUSH PRIVILEGES`](/sql-statements/sql-statement-flush-privileges.md) - - [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) - - [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) - - [`GRANT `](/sql-statements/sql-statement-grant-privileges.md) - - [`GRANT `](/sql-statements/sql-statement-grant-role.md) - - [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) - - [`INSERT`](/sql-statements/sql-statement-insert.md) - - [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md) - - [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) - - [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) - - [`LOCK STATS`](/sql-statements/sql-statement-lock-stats.md) - - [`LOCK TABLES` and `UNLOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) - - [`PREPARE`](/sql-statements/sql-statement-prepare.md) - - [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) - - [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) - - [`RENAME TABLE`](/sql-statements/sql-statement-rename-table.md) - - [`RENAME USER`](/sql-statements/sql-statement-rename-user.md) - - [`REPLACE`](/sql-statements/sql-statement-replace.md) - - [`RESTORE`](/sql-statements/sql-statement-restore.md) - - [`REVOKE `](/sql-statements/sql-statement-revoke-privileges.md) - - [`REVOKE `](/sql-statements/sql-statement-revoke-role.md) - - [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) - - [`SAVEPOINT`](/sql-statements/sql-statement-savepoint.md) - - [`SELECT`](/sql-statements/sql-statement-select.md) - - [`SET DEFAULT ROLE`](/sql-statements/sql-statement-set-default-role.md) - - [`SET [NAMES|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) - - [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) - - [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) - - [`SET ROLE`](/sql-statements/sql-statement-set-role.md) - - [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) - - [`SET [GLOBAL|SESSION] `](/sql-statements/sql-statement-set-variable.md) - - [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) - - [`SHOW [BACKUPS|RESTORES]`](/sql-statements/sql-statement-show-backups.md) - - [`SHOW [GLOBAL|SESSION] BINDINGS`](/sql-statements/sql-statement-show-bindings.md) - - [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) - - [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) - - [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) - - [`SHOW COLUMN_STATS_USAGE`](/sql-statements/sql-statement-show-column-stats-usage.md) - - [`SHOW COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) - - [`SHOW CREATE DATABASE`](/sql-statements/sql-statement-show-create-database.md) - - [`SHOW CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-show-create-placement-policy.md) - - [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) - - [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) - - [`SHOW CREATE TABLE`](/sql-statements/sql-statement-show-create-table.md) - - [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) - - [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) - - [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) - - [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) - - [`SHOW FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md) - - [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) - - [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) - - [`SHOW INDEXES [FROM|IN]`](/sql-statements/sql-statement-show-indexes.md) - - [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) - - [`SHOW PLACEMENT`](/sql-statements/sql-statement-show-placement.md) - - [`SHOW PLACEMENT FOR`](/sql-statements/sql-statement-show-placement-for.md) - - [`SHOW PLACEMENT LABELS`](/sql-statements/sql-statement-show-placement-labels.md) - - [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) - - [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) - - [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) - - [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) - - [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) - - [`SHOW STATS_BUCKETS`](/sql-statements/sql-statement-show-stats-buckets.md) - - [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) - - [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) - - [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) - - [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) - - [`SHOW STATS_TOPN`](/sql-statements/sql-statement-show-stats-topn.md) - - [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) - - [`SHOW TABLE NEXT_ROW_ID`](/sql-statements/sql-statement-show-table-next-rowid.md) - - [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) - - [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) - - [`SHOW TABLES`](/sql-statements/sql-statement-show-tables.md) - - [`SHOW [GLOBAL|SESSION] VARIABLES`](/sql-statements/sql-statement-show-variables.md) - - [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) - - [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) - - [`START TRANSACTION`](/sql-statements/sql-statement-start-transaction.md) - - [`TABLE`](/sql-statements/sql-statement-table.md) - - [`TRACE`](/sql-statements/sql-statement-trace.md) - - [`TRUNCATE`](/sql-statements/sql-statement-truncate.md) - - [`UNLOCK STATS`](/sql-statements/sql-statement-unlock-stats.md) - - [`UPDATE`](/sql-statements/sql-statement-update.md) - - [`USE`](/sql-statements/sql-statement-use.md) - - [`WITH`](/sql-statements/sql-statement-with.md) - - Data Types - - [Overview](/data-type-overview.md) - - [Default Values](/data-type-default-values.md) - - [Numeric Types](/data-type-numeric.md) - - [Date and Time Types](/data-type-date-and-time.md) - - [String Types](/data-type-string.md) - - [JSON Type](/data-type-json.md) - - Functions and Operators - - [Overview](/functions-and-operators/functions-and-operators-overview.md) - - [Type Conversion in Expression Evaluation](/functions-and-operators/type-conversion-in-expression-evaluation.md) - - [Operators](/functions-and-operators/operators.md) - - [Control Flow Functions](/functions-and-operators/control-flow-functions.md) - - [String Functions](/functions-and-operators/string-functions.md) - - [Numeric Functions and Operators](/functions-and-operators/numeric-functions-and-operators.md) - - [Date and Time Functions](/functions-and-operators/date-and-time-functions.md) - - [Bit Functions and Operators](/functions-and-operators/bit-functions-and-operators.md) - - [Cast Functions and Operators](/functions-and-operators/cast-functions-and-operators.md) - - [Encryption and Compression Functions](/functions-and-operators/encryption-and-compression-functions.md) - - [Locking Functions](/functions-and-operators/locking-functions.md) - - [Information Functions](/functions-and-operators/information-functions.md) - - JSON Functions - - [Overview](/functions-and-operators/json-functions.md) - - [Functions That Create JSON](/functions-and-operators/json-functions/json-functions-create.md) - - [Functions That Search JSON](/functions-and-operators/json-functions/json-functions-search.md) - - [Functions That Modify JSON](/functions-and-operators/json-functions/json-functions-modify.md) - - [Functions That Return JSON](/functions-and-operators/json-functions/json-functions-return.md) - - [JSON Utility Functions](/functions-and-operators/json-functions/json-functions-utility.md) - - [Functions That Aggregate JSON](/functions-and-operators/json-functions/json-functions-aggregate.md) - - [Aggregate (GROUP BY) Functions](/functions-and-operators/aggregate-group-by-functions.md) - - [GROUP BY Modifiers](/functions-and-operators/group-by-modifier.md) - - [Window Functions](/functions-and-operators/window-functions.md) - - [Miscellaneous Functions](/functions-and-operators/miscellaneous-functions.md) - - [Precision Math](/functions-and-operators/precision-math.md) - - [Set Operations](/functions-and-operators/set-operators.md) - - [Sequence Functions](/functions-and-operators/sequence-functions.md) - - [List of Expressions for Pushdown](/functions-and-operators/expressions-pushed-down.md) - - [TiDB Specific Functions](/functions-and-operators/tidb-functions.md) - - [Clustered Indexes](/clustered-indexes.md) - - [Constraints](/constraints.md) - - [Generated Columns](/generated-columns.md) - - [SQL Mode](/sql-mode.md) - - [Table Attributes](/table-attributes.md) - - Transactions - - [Overview](/transaction-overview.md) - - [Isolation Levels](/transaction-isolation-levels.md) - - [Optimistic Transactions](/optimistic-transaction.md) - - [Pessimistic Transactions](/pessimistic-transaction.md) - - [Non-Transactional DML Statements](/non-transactional-dml.md) - - [Views](/views.md) - - [Partitioning](/partitioned-table.md) - - [Temporary Tables](/temporary-tables.md) - - [Cached Tables](/cached-tables.md) - - [FOREIGN KEY Constraints](/foreign-key.md) - - Character Set and Collation - - [Overview](/character-set-and-collation.md) - - [GBK](/character-set-gbk.md) - - Read Historical Data - - Use Stale Read (Recommended) - - [Usage Scenarios of Stale Read](/stale-read.md) - - [Perform Stale Read Using `As OF TIMESTAMP`](/as-of-timestamp.md) - - [Perform Stale Read Using `tidb_read_staleness`](/tidb-read-staleness.md) - - [Perform Stale Read Using `tidb_external_ts`](/tidb-external-ts.md) - - [Use the `tidb_snapshot` System Variable](/read-historical-data.md) - - [Placement Rules in SQL](/placement-rules-in-sql.md) - - System Tables - - `mysql` Schema - - [Overview](/mysql-schema/mysql-schema.md) - - [`user`](/mysql-schema/mysql-schema-user.md) - - INFORMATION_SCHEMA - - [Overview](/information-schema/information-schema.md) - - [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) - - [`CHECK_CONSTRAINTS`](/information-schema/information-schema-check-constraints.md) - - [`CLIENT_ERRORS_SUMMARY_BY_HOST`](/information-schema/client-errors-summary-by-host.md) - - [`CLIENT_ERRORS_SUMMARY_BY_USER`](/information-schema/client-errors-summary-by-user.md) - - [`CLIENT_ERRORS_SUMMARY_GLOBAL`](/information-schema/client-errors-summary-global.md) - - [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) - - [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) - - [`COLLATIONS`](/information-schema/information-schema-collations.md) - - [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) - - [`COLUMNS`](/information-schema/information-schema-columns.md) - - [`DATA_LOCK_WAITS`](/information-schema/information-schema-data-lock-waits.md) - - [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) - - [`DEADLOCKS`](/information-schema/information-schema-deadlocks.md) - - [`ENGINES`](/information-schema/information-schema-engines.md) - - [`KEYWORDS`](/information-schema/information-schema-keywords.md) - - [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) - - [`MEMORY_USAGE`](/information-schema/information-schema-memory-usage.md) - - [`MEMORY_USAGE_OPS_HISTORY`](/information-schema/information-schema-memory-usage-ops-history.md) - - [`PARTITIONS`](/information-schema/information-schema-partitions.md) - - [`PLACEMENT_POLICIES`](/information-schema/information-schema-placement-policies.md) - - [`PROCESSLIST`](/information-schema/information-schema-processlist.md) - - [`REFERENTIAL_CONSTRAINTS`](/information-schema/information-schema-referential-constraints.md) - - [`RESOURCE_GROUPS`](/information-schema/information-schema-resource-groups.md) - - [`RUNAWAY_WATCHES`](/information-schema/information-schema-runaway-watches.md) - - [`SCHEMATA`](/information-schema/information-schema-schemata.md) - - [`SEQUENCES`](/information-schema/information-schema-sequences.md) - - [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) - - [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) - - [`STATISTICS`](/information-schema/information-schema-statistics.md) - - [`TABLES`](/information-schema/information-schema-tables.md) - - [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) - - [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) - - [`TIDB_CHECK_CONSTRAINTS`](/information-schema/information-schema-tidb-check-constraints.md) - - [`TIDB_HOT_REGIONS_HISTORY`](/information-schema/information-schema-tidb-hot-regions-history.md) - - [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) - - [`TIDB_INDEX_USAGE`](/information-schema/information-schema-tidb-index-usage.md) - - [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) - - [`TIDB_TRX`](/information-schema/information-schema-tidb-trx.md) - - [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) - - [`TIFLASH_SEGMENTS`](/information-schema/information-schema-tiflash-segments.md) - - [`TIFLASH_TABLES`](/information-schema/information-schema-tiflash-tables.md) - - [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) - - [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) - - [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) - - [`USER_ATTRIBUTES`](/information-schema/information-schema-user-attributes.md) - - [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) - - [`VARIABLES_INFO`](/information-schema/information-schema-variables-info.md) - - [`VIEWS`](/information-schema/information-schema-views.md) - - PERFORMANCE_SCHEMA - - [Overview](/performance-schema/performance-schema.md) - - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - - SYS - - [Overview](/sys-schema/sys-schema.md) - - [`schema_unused_indexes`](/sys-schema/sys-schema-unused-indexes.md) - - [Metadata Lock](/metadata-lock.md) - - [Use UUIDs](/best-practices/uuid.md) - - [TiDB Accelerated Table Creation](/accelerated-table-creation.md) - [System Variables](/system-variables.md) - [Server Status Variables](/status-variables.md) - - Storage Engines - - TiKV - - [TiKV Overview](/tikv-overview.md) - - [RocksDB Overview](/storage-engine/rocksdb-overview.md) - - TiFlash - - [TiFlash Overview](/tiflash/tiflash-overview.md) - - [Spill to Disk](/tiflash/tiflash-spill-disk.md) - - CLI - - [Overview](/tidb-cloud/cli-reference.md) - - auth - - [login](/tidb-cloud/ticloud-auth-login.md) - - [logout](/tidb-cloud/ticloud-auth-logout.md) - - [whoami](/tidb-cloud/ticloud-auth-whoami.md) - - serverless - - [create](/tidb-cloud/ticloud-cluster-create.md) - - [delete](/tidb-cloud/ticloud-cluster-delete.md) - - [describe](/tidb-cloud/ticloud-cluster-describe.md) - - [list](/tidb-cloud/ticloud-cluster-list.md) - - [update](/tidb-cloud/ticloud-serverless-update.md) - - [spending-limit](/tidb-cloud/ticloud-serverless-spending-limit.md) - - [region](/tidb-cloud/ticloud-serverless-region.md) - - [shell](/tidb-cloud/ticloud-serverless-shell.md) - - branch - - [create](/tidb-cloud/ticloud-branch-create.md) - - [delete](/tidb-cloud/ticloud-branch-delete.md) - - [describe](/tidb-cloud/ticloud-branch-describe.md) - - [list](/tidb-cloud/ticloud-branch-list.md) - - [shell](/tidb-cloud/ticloud-branch-shell.md) - - import - - [cancel](/tidb-cloud/ticloud-import-cancel.md) - - [describe](/tidb-cloud/ticloud-import-describe.md) - - [list](/tidb-cloud/ticloud-import-list.md) - - [start](/tidb-cloud/ticloud-import-start.md) - - export - - [create](/tidb-cloud/ticloud-serverless-export-create.md) - - [describe](/tidb-cloud/ticloud-serverless-export-describe.md) - - [list](/tidb-cloud/ticloud-serverless-export-list.md) - - [cancel](/tidb-cloud/ticloud-serverless-export-cancel.md) - - [download](/tidb-cloud/ticloud-serverless-export-download.md) - - sql-user - - [create](/tidb-cloud/ticloud-serverless-sql-user-create.md) - - [delete](/tidb-cloud/ticloud-serverless-sql-user-delete.md) - - [list](/tidb-cloud/ticloud-serverless-sql-user-list.md) - - [update](/tidb-cloud/ticloud-serverless-sql-user-update.md) - - [ai](/tidb-cloud/ticloud-ai.md) - - [completion](/tidb-cloud/ticloud-completion.md) - - config - - [create](/tidb-cloud/ticloud-config-create.md) - - [delete](/tidb-cloud/ticloud-config-delete.md) - - [describe](/tidb-cloud/ticloud-config-describe.md) - - [edit](/tidb-cloud/ticloud-config-edit.md) - - [list](/tidb-cloud/ticloud-config-list.md) - - [set](/tidb-cloud/ticloud-config-set.md) - - [use](/tidb-cloud/ticloud-config-use.md) - - project - - [list](/tidb-cloud/ticloud-project-list.md) - - [upgrade](/tidb-cloud/ticloud-upgrade.md) - - [help](/tidb-cloud/ticloud-help.md) - [Table Filter](/table-filter.md) + - Optimize Resource Allocation + - [Overview of Resource Allocation](/tidb-cloud/optimize-resource-allocation.md) + - [Resource Control](/tidb-resource-control.md) + - TiDB Node Group + - [Overview of TiDB Node Group](/tidb-cloud/tidb-node-group-overview.md) + - [Manage TiDB Node Groups](/tidb-cloud/tidb-node-group-management.md) - [URI Formats of External Storage Services](/external-storage-uri.md) - [DDL Execution Principles and Best Practices](/ddl-introduction.md) - [Troubleshoot Inconsistency Between Data and Indexes](/troubleshoot-data-inconsistency-errors.md) @@ -764,6 +791,9 @@ - FAQs - [TiDB Cloud FAQs](/tidb-cloud/tidb-cloud-faq.md) - [TiDB Cloud Serverless FAQs](/tidb-cloud/serverless-faqs.md) + +## RELEASES + - Release Notes - [2025](/tidb-cloud/tidb-cloud-release-notes.md) - [2024](/tidb-cloud/release-notes-2024.md) diff --git a/media/tidb-cloud/blank_transparent_placeholder.png b/media/tidb-cloud/blank_transparent_placeholder.png new file mode 100644 index 0000000000000..4d8ec8f7b4a1c Binary files /dev/null and b/media/tidb-cloud/blank_transparent_placeholder.png differ diff --git a/media/tidb-cloud/tidb-cloud-dedicated-architecture.png b/media/tidb-cloud/tidb-cloud-dedicated-architecture.png new file mode 100644 index 0000000000000..af2fb05877d57 Binary files /dev/null and b/media/tidb-cloud/tidb-cloud-dedicated-architecture.png differ diff --git a/tidb-cloud/ai-feature-concepts.md b/tidb-cloud/ai-feature-concepts.md new file mode 100644 index 0000000000000..d8b84c06c3464 --- /dev/null +++ b/tidb-cloud/ai-feature-concepts.md @@ -0,0 +1,50 @@ +--- +title: AI Features +summary: Learn about AI features for TiDB Cloud. +--- + +# AI Features + +The AI features in TiDB Cloud enable you to fully leverage advanced technologies for data exploration, search, and integration. From natural language-driven SQL query generation to high-performance vector search, TiDB combines database capabilities with modern AI features to power innovative applications. With support for popular AI frameworks, embedding models, and seamless integration with ORM libraries, TiDB offers a versatile platform for use cases such as semantic search and AI-powered analytics. + +This document highlights these AI features and how they enhance the TiDB experience. + +## Chat2Query + +Chat2Query is an AI-powered feature integrated into SQL Editor that assists users in generating, debugging, or rewriting SQL queries using natural language instructions. For more information, see [Explore your data with AI-assisted SQL Editor](/tidb-cloud/explore-data-with-chat2query.md). + +In addition, TiDB Cloud provides a Chat2Query API for TiDB Cloud Serverless clusters. After it is enabled, TiDB Cloud will automatically create a system Data App called Chat2Query and a Chat2Data endpoint in Data Service. You can call this endpoint to let AI generate and execute SQL statements by providing instructions. For more information, see [Get started with Chat2Query API](/tidb-cloud/use-chat2query-api.md). + +## Vector Search + +Vector search is a search method that prioritizes the meaning of your data to deliver relevant results. + +Unlike traditional full-text search, which relies on exact keyword matching and word frequency, vector search converts various data types (such as text, images, or audio) into high-dimensional vectors and queries based on the similarity between these vectors. This search method captures the semantic meaning and contextual information of the data, leading to a more precise understanding of user intent. + +Even when the search terms do not exactly match the content in the database, vector search can still provide results that align with the user's intent by analyzing the semantics of the data. For example, a full-text search for "a swimming animal" only returns results containing these exact keywords. In contrast, vector search can return results for other swimming animals, such as fish or ducks, even if these results do not contain the exact keywords. + +For more information, see [Vector Search (Beta) Overview](/tidb-cloud/vector-search-overview.md). + +## AI integrations + +### AI frameworks + +TiDB provides official support for several popular AI frameworks, enabling you to easily integrate AI applications developed based on these frameworks with TiDB Vector Search. + +For a list of supported AI frameworks, see [Vector Search Integration Overview](/tidb-cloud/vector-search-integration-overview.md#ai-frameworks). + +### Embedding models and services + +A vector embedding, also known as an embedding, is a sequence of numbers that represents real-world objects in a high-dimensional space. It captures the meaning and context of unstructured data, such as documents, images, audio, and videos. + +Embedding models are algorithms that transform data into [vector embeddings](/tidb-cloud/vector-search-overview.md#vector-embedding). The choice of an appropriate embedding model is crucial for ensuring the accuracy and relevance of semantic search results. + +TiDB Vector Search supports storing vectors of up to 16383 dimensions, which accommodates most embedding models. For unstructured text data, you can find top-performing text embedding models on the [Massive Text Embedding Benchmark (MTEB) Leaderboard](https://huggingface.co/spaces/mteb/leaderboard). + +### Object Relational Mapping (ORM) libraries + +Object Relational Mapping (ORM) libraries are tools that facilitate the interaction between applications and relational databases by allowing developers to work with database records as if they were objects in their programming language of choice. + +TiDB lets you integrate vector search with ORM libraries to manage vector data alongside traditional relational data. This integration is particularly useful for applications that need to store and query vector embeddings generated by AI models. By using ORM libraries, developers can seamlessly interact with vector data stored in TiDB, leveraging the database's capabilities to perform complex vector operations like nearest neighbor search. + +For a list of supported ORM libraries, see [Vector Search Integration Overview](/tidb-cloud/vector-search-integration-overview.md#object-relational-mapping-orm-libraries). \ No newline at end of file diff --git a/tidb-cloud/api-overview.md b/tidb-cloud/api-overview.md index 176bf2cdede7b..48d316a12b4da 100644 --- a/tidb-cloud/api-overview.md +++ b/tidb-cloud/api-overview.md @@ -3,7 +3,7 @@ title: TiDB Cloud API Overview summary: Learn about what is TiDB Cloud API, its features, and how to use API to manage your TiDB Cloud clusters. --- -# TiDB Cloud API Overview Beta +# TiDB Cloud API Overview (Beta) > **Note:** > diff --git a/tidb-cloud/architecture-concepts.md b/tidb-cloud/architecture-concepts.md new file mode 100644 index 0000000000000..4c694371190ce --- /dev/null +++ b/tidb-cloud/architecture-concepts.md @@ -0,0 +1,104 @@ +--- +title: Architecture +summary: Learn about architecture concepts for TiDB Cloud. +--- + +# Architecture + +TiDB Cloud is a fully-managed Database-as-a-Service (DBaaS) that brings the flexibility and power of [TiDB](https://docs.pingcap.com/tidb/stable/overview), an open-source HTAP (Hybrid Transactional and Analytical Processing) database, to Google Cloud and AWS. + +TiDB is MySQL-compatible, making it easy to migrate and work with existing applications, while offering seamless scalability to handle everything from small workloads to massive, high-performance clusters. It supports both transactional (OLTP) and analytical (OLAP) workloads in one system, simplifying operations and enabling real-time insights. + +TiDB Cloud provides two deployment options: **TiDB Cloud** **Serverless**, for auto-scaling, cost-efficient workloads, and **TiDB Cloud Dedicated**, for enterprise-grade applications with dedicated resources and advanced capabilities. TiDB Cloud makes it easy to scale your database, handle complex management tasks, and stay focused on developing reliable, high-performing applications. + +## TiDB Cloud Serverless + +TiDB Cloud Serverless is a fully managed serverless solution that provides HTAP capabilities similar to traditional TiDB, while offering auto-scaling to alleviate users' burdens related to capacity planning and management complexities. It includes a free tier for basic usage, with consumption-based billing for any usage that exceeds the free limits. TiDB Cloud Serverless offers two types of high availability to address varying operational requirements. + +By default, clusters utilizing the Zonal High Availability option have all components located within the same availability zone, which results in lower network latency. + +![TiDB Cloud Serverless zonal high availability](/media/tidb-cloud/serverless-zonal-high-avaliability-aws.png) + +For applications that require maximum infrastructure isolation and redundancy, the Regional High Availability option distributes nodes across multiple availability zones. + +![TiDB Cloud Serverless regional high availability](/media/tidb-cloud/serverless-regional-high-avaliability-aws.png) + +## TiDB Cloud Dedicated + +TiDB Cloud Dedicated is designed for mission-critical businesses, offering high availability across multiple availability zones, horizontal scaling, and full HTAP capabilities. + +Built on isolated cloud resources such as VPCs, VMs, managed Kubernetes services, and cloud storage, it leverages the infrastructure of major cloud providers. TiDB Cloud Dedicated clusters support the complete TiDB feature set, enabling rapid scaling, reliable backups, deployment within specific VPCs, and geographic-level disaster recovery. + +![TiDB Cloud Dedicated Architecture](/media/tidb-cloud/tidb-cloud-dedicated-architecture.png) + +## TiDB Cloud console + +The [TiDB Cloud console](https://tidbcloud.com/) is the web-based management interface for both TiDB Cloud Serverless and TiDB Cloud Dedicated. It provides tools to manage clusters, import or migrate data, monitor performance metrics, configure backups, set up security controls, and integrate with other cloud services, all from a single, user-friendly platform. + +## TiDB Cloud CLI + +The TiDB Cloud CLI, `ticloud`, allows you to manage TiDB Cloud Serverless and TiDB Cloud Dedicated directly from your terminal with simple commands. You can perform tasks such as: + +- Creating, deleting, and listing clusters. +- Importing data into clusters. +- Exporting data from clusters. + +For more information, see [TiDB Cloud CLI Reference](/tidb-cloud/cli-reference.md). + +## TiDB Cloud API + +The TiDB Cloud API is a REST-based interface that provides programmatic access to manage resources across TiDB Cloud Serverless and TiDB Cloud Dedicated. It enables automated and efficient handling of tasks such as managing projects, clusters, backups, restores, data imports, billing, and other resources in [TiDB Cloud Data Service](/tidb-cloud/data-service-overview.md). + +For more information, see [TiDB Cloud API Overview](/tidb-cloud/api-overview.md). + +## Nodes + +In TiDB Cloud, each cluster consists of TiDB, TiKV, and TiFlash nodes. + +- In a TiDB Cloud Dedicated cluster, you can fully manage the number and size of your dedicated TiDB, TiKV, and TiFlash nodes according to your performance requirements. For more information, see [Scalability](/tidb-cloud/scalability-concepts.md). +- In a TiDB Cloud Serverless cluster, the number and size of TiDB, TiKV, and TiFlash nodes are automatically managed. This ensures seamless scaling, eliminating the need for users to handle node configuration or management tasks. + +### TiDB node + +A [TiDB node](/tidb-computing.md) is a stateless SQL layer that connects to applications using a MySQL-compatible endpoint. It handles tasks like parsing, optimizing, and creating distributed execution plans for SQL queries. + +You can deploy multiple TiDB nodes to scale horizontally and manage higher workloads. These nodes work with load balancers, such as TiProxy or HAProxy, to provide a seamless interface. TiDB nodes do not store data themselves---they forward data requests to TiKV nodes for row-based storage or TiFlash nodes for columnar storage. + +### TiKV node + +A [TiKV node](/tikv-overview.md) is the backbone of data storage in the TiDB architecture, serving as a distributed transactional key-value storage engine that delivers reliability, scalability, and high availability. + +**Key features:** + +- **Region-based data storage** + + - Data is divided into [Regions](https://docs.pingcap.com/tidb/dev/glossary#regionpeerraft-group), each covering a specific Key Range (left-closed, right-open interval: `StartKey` to `EndKey`). + - Multiple Regions coexist within each TiKV node to ensure efficient data distribution. + +- **Transactional support** + + - TiKV nodes provide native distributed transaction support at the key-value level, ensuring Snapshot Isolation as the default isolation level. + - The TiDB node translates SQL execution plans into calls to the TiKV node API, enabling seamless SQL-level transaction support. + +- **High availability** + + - All data in TiKV nodes is replicated (default: three replicas) for durability. + - TiKV ensures native high availability and supports automatic failover, safeguarding against node failures. + +- **Scalability and reliability** + + - TiKV nodes are designed to handle expanding datasets while maintaining distributed consistency and fault tolerance. + +### TiFlash node + +A [TiFlash node](/tiflash/tiflash-overview.md) is a specialized type of storage node within the TiDB architecture. Unlike ordinary TiKV nodes, TiFlash is designed for analytical acceleration with a columnar storage model. + +**Key features:** + +- **Columnar storage** + + TiFlash nodes store data in a columnar format, making them optimized for analytical queries and significantly improving performance for read-intensive workloads. + +- **Vector search index support** + + The vector search index feature uses TiFlash replicas for tables, enabling advanced search capabilities and improving efficiency in complex analytical scenarios. \ No newline at end of file diff --git a/tidb-cloud/backup-and-restore-concepts.md b/tidb-cloud/backup-and-restore-concepts.md new file mode 100644 index 0000000000000..5ce29b6ef2896 --- /dev/null +++ b/tidb-cloud/backup-and-restore-concepts.md @@ -0,0 +1,47 @@ +--- +title: Backup & Restore +summary: Learn about backup & restore concepts for TiDB Cloud. +--- + +# Backup & Restore + +TiDB Cloud Backup & Restore features are designed to safeguard your data and ensure business continuity by enabling you to back up and recover cluster data. + +## Snapshot backup + +Snapshot backup is an implementation to back up the entire cluster. It is based on [multi-version concurrency control (MVCC)](/tidb-storage.md#mvcc) and backs up all data in the specified snapshot to a target storage. The size of the backup data is approximately the size of the compressed single replica in the cluster. + +## Automatic backup + +For both TiDB Cloud Serverless and TiDB Cloud Dedicated clusters, snapshot backups are taken automatically by default and stored according to your backup retention policy. + +## Log backup + +Snapshot backup contains the full cluster data at a certain point, while TiDB log backup can back up data written by applications to a specified storage in a timely manner. + +If you want to choose the restore point as required, that is, to perform point-in-time recovery (PITR), note the following: + +- For TiDB Cloud Serverless clusters, PITR is available only for scalable clusters and not available for free clusters. +- For TiDB Cloud Dedicated clusters, you need to [enable PITR](/tidb-cloud/backup-and-restore.md#turn-on-point-in-time-restore) in advance. + +## Manual backup + +Dual region backup is a feature of TiDB Cloud Dedicated that enables you to back up your data to a known state as needed, and then restore to that state at any time. + +For more information, see [Perform a manual backup](/tidb-cloud/backup-and-restore.md#perform-a-manual-backup). + +## Dual region backup + +Dual region backup is a feature of TiDB Cloud Dedicated that enables you to replicate backups from your cluster region to another different region. After it is enabled, all backups are automatically replicated to the specified region. This provides cross-region data protection and disaster recovery capabilities. It is estimated that approximately 99% of the data can be replicated to the secondary region within an hour. + +For more information, see [Turn on dual region backup](/tidb-cloud/backup-and-restore.md#turn-on-dual-region-backup). + +## Point-in-time Restore + +Point-in-time Restore is a feature that enables you to restore data of any point in time to a new cluster. You can use it to: + +- Reduce RPO in disaster recovery. +- Resolve cases of data write errors by restoring point-in-time that is before the error event. +- Audit the historical data of the business. + +For more information, see [Turn on Point-in-time Restore](/tidb-cloud/backup-and-restore.md#turn-on-point-in-time-restore). \ No newline at end of file diff --git a/tidb-cloud/cli-reference.md b/tidb-cloud/cli-reference.md index 674e1871715e3..63b52449cba66 100644 --- a/tidb-cloud/cli-reference.md +++ b/tidb-cloud/cli-reference.md @@ -3,7 +3,7 @@ title: TiDB Cloud CLI Reference summary: Provides an overview of TiDB Cloud CLI. --- -# TiDB Cloud CLI Reference Beta +# TiDB Cloud CLI Reference (Beta) > **Note:** > diff --git a/tidb-cloud/data-service-concepts.md b/tidb-cloud/data-service-concepts.md new file mode 100644 index 0000000000000..677376f8976e9 --- /dev/null +++ b/tidb-cloud/data-service-concepts.md @@ -0,0 +1,46 @@ +--- +title: Data Service (Beta) +summary: Learn about Data Service concepts for TiDB Cloud. +--- + +# Data Service (Beta) + +TiDB Cloud [Data Service (beta)](https://tidbcloud.com/console/data-service) is a fully managed low-code backend-as-a-service solution that simplifies backend application development, empowering developers to rapidly build highly scalable, secure, data-driven applications. + +Data Service enables you to access TiDB Cloud data via an HTTPS request using a custom API endpoint. This feature uses a serverless architecture to handle computing resources and elastic scaling, so you can focus on the query logic in endpoints without worrying about infrastructure or maintenance costs. + +For more information, see [TiDB Cloud Data Service (Beta) Overview](/tidb-cloud/data-service-overview.md). + +## Data App + +A Data App in [Data Service (beta)](https://tidbcloud.com/console/data-service) is a collection of endpoints that you can use to access data for a specific application. By creating a Data App, you can group your endpoints and configure authorization settings using API keys to restrict access to endpoints. In this way, you can ensure that only authorized users can access and manipulate your data, making your application more secure. + +For more information, see [Manage a Data App](/tidb-cloud/data-service-manage-data-app.md). + +## Data App endpoints + +An endpoint in [Data Service (beta)](https://tidbcloud.com/console/data-service) is a web API that you can customize to execute SQL statements. You can specify parameters for your SQL statements, such as the value used in the `WHERE` clause. When a client calls an endpoint and provides values for the parameters in a request URL, the endpoint executes the corresponding SQL statement with the provided parameters and returns the results as part of the HTTP response. + +For more information, see [Manage an Endpoint](/tidb-cloud/data-service-manage-endpoint.md). + +## Chat2Query API + +In TiDB Cloud, Chat2Query API is a RESTful interface that enables you to generate and execute SQL statements using AI by providing instructions. Then, the API returns the query results for you. + +For more information, see [Get Started with Chat2Query API](/tidb-cloud/use-chat2query-api.md). + +## AI integrations + +Integrating third-party tools with your Data App enhances your applications with advanced natural language processing and artificial intelligence (AI) capabilities provided by third-party tools. This integration enables your applications to perform more complex tasks and deliver intelligent solutions. + +Currently, you can integrate third-party tools, such as GPTs and Dify, in the TiDB Cloud console. +For more information, see [Integrate a Data App with Third-Party Tools](/tidb-cloud/data-service-integrations.md). + +## Configuration as Code + +TiDB Cloud provides a Configuration as Code (CaC) approach to represent your entire Data App configurations as code using the JSON syntax. + +By connecting your Data App to GitHub, TiDB Cloud can use the CaC approach and push your Data App configurations as [configuration files](/tidb-cloud/data-service-app-config-files.md) to your preferred GitHub repository and branch. +If Auto Sync & Deployment is enabled for your GitHub connection, you can also modify your Data App by updating its configuration files on GitHub. After you push the configuration file changes to GitHub, the new configurations will be deployed in TiDB Cloud automatically. + +For more information, see [Deploy Data App Automatically with GitHub](/tidb-cloud/data-service-manage-github-connection.md). \ No newline at end of file diff --git a/tidb-cloud/data-streaming-concepts.md b/tidb-cloud/data-streaming-concepts.md new file mode 100644 index 0000000000000..665057f4e9a92 --- /dev/null +++ b/tidb-cloud/data-streaming-concepts.md @@ -0,0 +1,22 @@ +--- +title: Data Streaming +summary: Learn about data streaming concepts for TiDB Cloud. +--- + +# Data Streaming + +TiDB Cloud lets you stream data changes from your TiDB Cluster to other systems like Kafka, MySQL, and object storage. + +Currently, TiDB Cloud supports streaming data to Apache Kafka, MySQL, TiDB Cloud and cloud storage. + +## Changefeed + +TiDB Cloud changefeed is a continuous data stream that helps you replicate data changes from TiDB Cloud to other data services. + +On the changefeed page in the TiDB Cloud console, you can create a changefeed, view a list of existing changefeeds, and operate the existing changefeeds (such as scaling, pausing, resuming, editing, and deleting a changefeed). + +Replication includes only incremental data changes by default. If existing data must be replicated, it must be exported and loaded into the target system manually before starting the changefeed. + +In TiDB Cloud, replication can be tailored by defining table filters (to specify which tables to replicate) and event filters (to include or exclude specific types of events like INSERT or DELETE). + +For more information, see [Changefeed](/tidb-cloud/changefeed-overview.md). \ No newline at end of file diff --git a/tidb-cloud/database-schema-concepts.md b/tidb-cloud/database-schema-concepts.md new file mode 100644 index 0000000000000..162e2be08a4ae --- /dev/null +++ b/tidb-cloud/database-schema-concepts.md @@ -0,0 +1,172 @@ +--- +title: Database Schema +summary: Learn about database schema concepts for TiDB Cloud. +--- + +# Database Schema + +A database schema defines the structure and organization of data within databases, tables, columns, indexes, and other objects. + +This document introduces the key concepts of database schemas, such as databases, tables, columns, data types, constraints, and indexes. It also introduces advanced features such as temporary tables for managing intermediate data seamlessly, vector indexes for efficient approximate nearest neighbor (ANN) searches, and cached tables to improve read performance. + +## Databases + +A database in TiDB is a collection of objects such as tables and indexes. + +### System databases + +System databases are default databases created by TiDB to store system tables. TiDB provides the following system databases: + +- [`INFORMATION_SCHEMA`](/information-schema/information-schema.md) + +- [`mysql`](/mysql-schema/mysql-schema.md) + +- [`performance_schema`](/performance-schema/performance-schema.md) + +- [`sys`](/sys-schema/sys-schema.md) + +### `test` database + +TiDB comes with a default database named `test`. However, it is recommended that you create your own database instead of using the `test` database. + +## Tables + +A table is a collection of related data in a [database](/develop/dev-guide-schema-design-overview.md#database). + +Each table consists of rows and columns. Each value in a row belongs to a specific column. Each column allows only a single data type. To further qualify columns, you can add some [constraints](/constraints.md). To accelerate calculations, you can add [generated columns](/generated-columns.md). + +### System table + +- The `mysql` schema contains TiDB system tables. The design is similar to the `mysql` schema in MySQL, where tables such as `mysql.user` can be edited directly. It also contains a number of tables which are extensions to MySQL. + +- Information Schema provides an ANSI-standard way of viewing system metadata. TiDB also provides a number of custom `INFORMATION_SCHEMA` tables, in addition to the tables included for MySQL compatibility. Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables. + +- Performance Schema. TiDB implements performance schema tables for MySQL compatibility. + +### Cached table + +TiDB introduces the [cached table](/cached-tables.md) feature for frequently accessed but rarely updated small hotspot tables. When this feature is used, the data of an entire table is loaded into the memory of the TiDB server, and TiDB directly gets the table data from the memory without accessing TiKV, which improves the read performance. + +### Temporary table + +The temporary tables feature solves the issue of temporarily storing the intermediate results of an application, which frees you from frequently creating and dropping tables. You can store the intermediate calculation data in temporary tables. When the intermediate data is no longer needed, TiDB automatically cleans up and recycles the temporary tables. This avoids user applications being too complicated, reduces table management overhead, and improves performance. + +### Partitioned table + +In TiDB, [partitioning](/partitioned-table.md) enables you to divide a large table into one or more manageable pieces called partitions. Each partition is independent and can be managed individually. + +## Columns + +A column is subordinate to a table. Each table has at least one column. Columns provide a structure to a table by dividing the values in each row into small cells of a single data type. + +For more information, see [Define columns](/develop/dev-guide-create-table.md#define-columns). + +## Generated columns + +TiDB lets you extract data from the JSON data type as a [generated column](/generated-columns.md). + +Unlike general columns, the value of the generated column is calculated by the expression in the column definition. When inserting or updating a generated column, you cannot assign a value, but only use `DEFAULT`. + +There are two kinds of generated columns: virtual and stored. A virtual generated column occupies no storage and is computed when it is read. A stored generated column is computed when it is written (inserted or updated) and occupies storage. Compared with the virtual generated columns, the stored generated columns have better read performance, but take up more disk space. + +## Data types + +TiDB supports all the data types in MySQL except the `SPATIAL` type. This includes all the [numeric types](/data-type-numeric.md), [string types](/data-type-string.md), [date & time types](/data-type-date-and-time.md), and [the JSON type](/data-type-json.md). + +## Indexes + +An index is a copy of selected columns in a table. You can create an index using one or more columns of a [table](/develop/dev-guide-schema-design-overview.md#table). With indexes, TiDB can quickly locate data without having to search every row in a table every time, which greatly improves your query performance. +There are two common types of indexes: + +- Primary Key: indexes on the primary key column. + +- Secondary Index: indexes on non-primary key column + +### Unique indexes + +A unique index in TiDB enforces uniqueness on one or more columns, ensuring that no two rows in a table can have the same values in the indexed column(s). This constraint provides a way to maintain data integrity by preventing duplicate values, making unique indexes ideal for fields that should naturally be unique, like email addresses, usernames, or product codes. + +### Primary key index + +A primary key index is a unique index on one or more columns in a table, which serves as the primary identifier for each row. In TiDB, every table must have a primary key, and it can be defined explicitly by the user or implicitly by TiDB if no primary key is specified. + +### Composite index + +A composite index is an index built on two or more columns of a table, which is particularly useful for queries that filter or sort data by multiple fields. For example, creating a composite index on `last_name` and `first_name` in a person table allows TiDB to quickly locate records based on both names. + +### Invisible indexes + +Invisible indexes are indexes that exist in the database but are hidden from the query optimizer, meaning they are ignored in query plans. In TiDB, invisible indexes are useful for testing and debugging, allowing you to assess the impact of an index on performance without fully dropping it. + +Starting from TiDB v8.0.0, you can make the optimizer select invisible indexes by modifying the system variable[`tidb_opt_use_invisible_indexes`](/system-variables.md#tidb_opt_use_invisible_indexes-new-in-v800). + +### Clustered indexes + +In clustered indexes, the term clustered refers to the organization of how data is stored and not a group of database servers working together. Some database management systems refer to clustered indexes as index-organized tables (IOT). + +This feature controls how data is stored in tables containing primary keys. It provides TiDB with the ability to organize tables in a way that can improve the performance of certain queries. + +For more information, see [Clustered Indexes](/clustered-indexes.md). + +### Secondary index + +A secondary index is a logical object in a TiDB cluster. You can simply regard it as a sorting type of data that TiDB uses to improve the query performance. In TiDB, creating a secondary index is an online operation, which does not block any data read and write operations on a table. For each index, TiDB creates references for each row in a table and sorts the references by selected columns instead of by data directly. + +For more information about secondary indexes, see [Secondary Indexes](https://docs.pingcap.com/tidb/stable/tidb-best-practices#secondary-index). + +In TiDB, you can either [add a secondary index to an existing table](/develop/dev-guide-create-secondary-indexes.md#add-a-secondary-index-to-an-existing-table) or [create a secondary index when creating a new table](/develop/dev-guide-create-secondary-indexes.md#create-a-secondary-index-when-creating-a-new-table). + +### Vector index + +For the following TiDB deployment options, TiDB supports vector data types and vector search indexes. + +- TiDB Cloud Serverless + +- TiDB Self-Managed v8.4.0 or later versions + +In TiDB, a *vector index* is a specialized index designed for efficient approximate nearest neighbor (ANN) searches over columns containing vector data. Vector indexes, particularly the HNSW (Hierarchical Navigable Small World) algorithm, allow K-nearest neighbors (KNN) searches to identify the closest data points in a vector space quickly. This significantly speeds up query performance, enabling results in milliseconds compared to brute-force methods. +Vector indexes rely on TiFlash replicas for data storage and search functionality. Before creating and using vector indexes, make sure that TiFlash nodes are available in your cluster. + +## Constraints + +TiDB supports almost the same constraints as MySQL. + +### NOT NULL constraints + +A `NOT NULL` constraint ensures that a column cannot contain `NULL` values. +When a column is defined with the `NOT NULL` constraint, TiDB ensures that any attempt to insert or update a row with a `NULL` value in that column will result in an error. This behavior is consistent with MySQL's implementation of `NOT NULL` constraints. + +### CHECK constraints + +A `CHECK` constraint restricts the values of a column in a table to meet your specified conditions. When the `CHECK` constraint is added to a table, TiDB checks whether the constraint is satisfied during the insertion or updates of data into the table. If the constraint is not met, an error is returned. + +### Primary key constraints + +Like MySQL, primary key constraints in TiDB contain unique constraints, that is, creating a primary key constraint is equivalent to having a unique constraint. In addition, other primary key constraints of TiDB are also similar to those of MySQL. + +### Unique key constraints + +Unique constraints mean that all non-null values in a unique index and a primary key column are unique. + +### FOREIGN KEY constraints + +A FOREIGN KEY is a database constraint that enforces referential integrity between two tables by linking a column in one table (the child table) to a column in another table (the parent table). This ensures that the values in the foreign key column of the child table match values in the primary or unique key column of the parent table. For example, a record in an `orders` table might have a foreign key linking to a customer in a `customers` table, which ensures that each order is associated with a valid customer. + +Starting from v6.6.0, TiDB supports foreign key constraints as an experimental feature. This feature allows cross-table referencing of related data and helps maintain data consistency by enforcing referential integrity. However, it is important to note that this feature is experimental and not recommended for production environments due to potential performance issues, especially with large data volumes. +For more information, see [FOREIGN KEY constraints](/foreign-key.md). + +## Views + +A view acts as a virtual table, whose schema is defined by the `SELECT` statement that creates the view. Using views has the following benefits: + +- Exposing only safe fields and data to users to ensure security of sensitive fields and data stored in the underlying table. + +- Defining complex queries that frequently appear as views to make complex queries easier and more convenient. + +For more information, see [Views](/views.md). + +## Sequence + +A sequence is a database object designed to generate a sequence of numbers according to a specified set of rules. This feature is especially useful in scenarios where unique identifiers are required, such as in the creation of primary keys for database tables. + +For more information, see [sequence](/sql-statements/sql-statement-create-sequence.md). \ No newline at end of file diff --git a/tidb-cloud/monitoring-concepts.md b/tidb-cloud/monitoring-concepts.md new file mode 100644 index 0000000000000..9bdb9d931577b --- /dev/null +++ b/tidb-cloud/monitoring-concepts.md @@ -0,0 +1,47 @@ +--- +title: Monitoring +summary: Learn about monitoring concepts for TiDB Cloud. +--- + +# Monitoring + +Monitoring in TiDB Cloud provides tools and integrations that enable you to oversee cluster performance, track activity, and respond to issues in a timely manner. + +## Built-in metrics + +Built-in Metrics refer to a full set of standard metrics of your cluster that TiDB Cloud collects and presents on the Metrics page. With these metrics, you can easily identify performance issues and determine whether your current database deployment meets your requirements. + +For more information, see [TiDB Cloud Built-in Metrics](/tidb-cloud/built-in-monitoring.md). + +## Built-in alerting + +Built-in alerting refers to the cluster alerting mechanism that TiDB Cloud provides to assist you in monitoring your cluster. Currently, TiDB Cloud provides the following three types of alerts: + +- Resource usage alerts + +- Data migration alerts + +- Changefeed alerts + +On the Alerts page of the TiDB Cloud console, you can view alerts of your cluster, edit alert rules, and subscribe to alert notification emails. + +For more information, see [TiDB Cloud Built-in Alerting](/tidb-cloud/monitor-built-in-alerting.md). + +## Cluster events + +In TiDB Cloud, an *event* indicates a change in your TiDB Cloud cluster. TiDB Cloud logs the historical events at the cluster level to help you track cluster activities. You can view the logged events on the **Events** page, including the event type, status, message, trigger time, and trigger user. + +For more information, see [TiDB Cloud Cluster Event](/tidb-cloud/tidb-cloud-events.md). + +## Third-party metrics integrations (Beta) + +TiDB Cloud lets you integrate any of the following third-party metrics services to receive TiDB Cloud alerts and view the performance metrics of your TiDB cluster. + +- Datadog integration + +- Prometheus and Grafana integration + +- New Relic integration + +Currently, these third-party metrics integrations are in beta. +For more information, see [Third-Party Metrics Integration (Beta)](/tidb-cloud/third-party-monitoring-integrations.md). \ No newline at end of file diff --git a/tidb-cloud/scalability-concepts.md b/tidb-cloud/scalability-concepts.md new file mode 100644 index 0000000000000..e2cc9608af1da --- /dev/null +++ b/tidb-cloud/scalability-concepts.md @@ -0,0 +1,47 @@ +--- +title: Scalability +summary: Learn about scalability concepts for TiDB Cloud. +--- + +# Scalability + +TiDB Cloud Dedicated lets you adjust its compute and storage resources separately to match your data volume or workload changes. TiDB Cloud Dedicated can do scaling without any service disruption. This flexibility allows organizations to optimize their infrastructure costs while maintaining high performance and availability. + +> **Note:** +> +> [TiDB Cloud Serverless](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-cloud-serverless) scales automatically based on your application's workload changes. However, you cannot manually scale a TiDB Cloud Serverless cluster. + +> **Tip:** +> +> For information about how to determine the size of a TiDB Cloud Dedicated cluster, see [Determine Your TiDB Size](/tidb-cloud/size-your-cluster.md). + +## Vertical and horizontal scaling + +TiDB Cloud Dedicated supports both vertical (scale up) and horizontal (scale out) scaling. + +- Horizontal scaling is the process of adding nodes to your dedicated cluster to distribute the workload. +- Vertical scaling is the process of increasing the vCPU and RAM for your dedicated cluster. + +A combination of both vertical and horizontal scaling is also supported in TiDB Cloud Dedicated. + +## TiDB scalability + +TiDB is for computing only and does not store data. You can configure node number, vCPU, and RAM for TiDB. + +In general, TiDB performance increases linearly with the number of TiDB nodes. + +## Storage scalability + +In TiDB Cloud, you can scale both row-based and columnar data storage on-demand to meet changing workloads and performance requirements + +## TiKV scalability + +TiKV is responsible for storing row-based data. You can configure node number, vCPU and RAM, and storage for TiKV. The number of TiKV nodes should be at least 1 set (3 nodes in 3 different Available Zones) and increase by 3 nodes. + +TiDB Cloud deploys TiKV nodes evenly to 3 available zones in the region you select to achieve durability and high availability. In a typical 3-replica setup, your data is distributed evenly among the TiKV nodes across all availability zones and is persisted to the disk of each TiKV node. Although TiKV is mainly used for data storage, the performance of the TiKV node also varies depending on different workloads. + +## TiFlash scalability + +TiFlash is responsible for storing columnar data. TiFlash synchronizes data from TiKV in real time and supports real-time analytics workloads right out of the box. You can configure node number, vCPU and RAM, and storage for TiFlash. + +TiDB Cloud deploys TiFlash nodes evenly to different availability zones in a region. It is recommended that you configure at least two TiFlash nodes in each TiDB Cloud cluster and create at least two replicas of the data for high availability in your production environment. \ No newline at end of file diff --git a/tidb-cloud/security-concepts.md b/tidb-cloud/security-concepts.md new file mode 100644 index 0000000000000..9bc598d269945 --- /dev/null +++ b/tidb-cloud/security-concepts.md @@ -0,0 +1,244 @@ +--- +title: Security +summary: Learn about security concepts for TiDB Cloud. +--- + +# Security + +TiDB Cloud provides a robust and flexible security framework designed to protect data, enforce access control, and meet modern compliance standards. This framework combines advanced security features with operational efficiency to support organizational needs at scale. + +**Key components** + +- **Identity and Access Management (IAM)**: Secure and flexible authentication and permission management for both the TiDB Cloud console and database environments. + +- **Network access control**: Configurable connectivity options, including private endpoints, VPC peering, TLS encryption, and IP access lists. + +- **Data access control**: Advanced encryption capabilities, such as Customer-Managed Encryption Keys (CMEK), to safeguard data at rest. + +- **Audit logging**: Comprehensive activity tracking for both console actions and database operations, ensuring accountability and transparency. + +By integrating these capabilities, TiDB Cloud empowers organizations to safeguard sensitive data, streamline access control, and optimize security operations. + +## Identity and access management (IAM) + +TiDB Cloud employs Identity and Access Management (IAM) to securely and efficiently manage user identities and permissions across both the console and database environments. IAM features are designed to meet organizational security and compliance needs through a combination of authentication options, role-based access control, and a hierarchical resource structure. + +### TiDB Cloud user accounts + +TiDB Cloud user accounts are the foundation for managing identity and access to resources. Each account represents an individual or entity within the platform and supports multiple authentication methods to suit organizational needs: + +- **Default username and password** + + - Users create accounts with an email address and password. + + - Suitable for small teams or individuals without an external identity provider. + +- **Standard SSO authentication** + + - Users log in via GitHub, Google, or Microsoft accounts. + + - Enabled by default for all organizations. + + - **Best practice**: Use for smaller teams or those without strict compliance needs. + + - For more information, see [Standard SSO Authentication](/tidb-cloud/tidb-cloud-sso-authentication.md). + +- **Organization SSO authentication** + + - Integrates with corporate identity providers (IdPs) using OIDC or SAML protocols. + + - Enables features like MFA enforcement, password expiration policies, and domain restrictions. + + - **Best practice**: Ideal for larger organizations with advanced security and compliance requirements. + + - For more information, see [Organization SSO Authentication](/tidb-cloud/tidb-cloud-org-sso-authentication.md). + +### Database access control + +TiDB Cloud provides granular database access control through user-based and role-based permissions. These mechanisms allow administrators to securely manage access to data objects and schemas while ensuring compliance with organizational security policies. + +- **Best practices:** + + - Implement the principle of least privilege by granting users only the permissions they need for their roles. + + - Regularly audit and update user access to align with changing organizational requirements. + +### Database user accounts + +Database user accounts are stored in the `mysql.user` system table and uniquely identified by a username and client host. + +During database initialization, TiDB automatically creates a default account: `'root'@'%'`. + +For more information, see [TiDB User Account Management](https://docs.pingcap.com/tidb/stable/user-account-management#user-names-and-passwords). + +### SQL Proxy accounts + +SQL Proxy accounts are special-purpose accounts automatically generated by TiDB Cloud. Key characteristics of these accounts include the following: + +- **Linked to TiDB Cloud user accounts:** Each SQL Proxy account corresponds to a specific TiDB Cloud user. + +- **Mapped to roles:** SQL Proxy accounts are granted the `role_admin` role. + +- **Token-based:** SQL Proxy accounts use secure JWT tokens instead of passwords, ensuring seamless, restricted access through the TiDB Cloud Data Service or SQL Editor. + +### TiDB privileges and roles + +TiDB's privilege management system is based on MySQL 5.7, which enables fine-grained access to database objects. At the same time, TiDB also introduces MySQL 8.0's RBAC and dynamic privilege mechanism. This enables fine-grained and convenient management of database privileges. + +**Static privileges** + +- Supports fine-grained access control based on database objects, including tables, views, indexes, users, and other objects. + +- *Example: Grant SELECT privileges on a specific table to a user.* + +**Dynamic privileges** + +- Supports reasonable splitting of database management privileges to achieve fine-grained control of system management privileges. + +- Example: Assign `BACKUP_ADMIN` to accounts managing database backups without broader administrative permissions. + +**SQL roles (RBAC)** + +- Group permissions into roles that can be assigned to users, enabling streamlined privilege management and dynamic updates. + +- Example: Assign a read-write role to analysts to simplify user access control. + +This system ensures flexibility and precision in managing user access while aligning with organizational policies. + +### Organization and projects + +TiDB Cloud manages users and resources with a hierarchical structure: organizations, projects, and clusters. + +**Organizations** + +- The top-level entity for managing resources, roles, and billing. + +- The organization owner has full permissions, including project creation and role assignment. + +**Projects** + +- Subdivisions of an organization containing clusters and project-specific configurations. + +- Managed by project owners responsible for clusters within their scope. + +**Clusters** + +- Individual database instances within a project. + +### Example structure + +``` +- Your organization + - Project 1 + - Cluster 1 + - Cluster 2 + - Project 2 + - Cluster 3 + - Cluster 4 + - Project 3 + - Cluster 5 + - Cluster 6 + +``` + +### Key features + +- **Granular permissions**: + - Assign specific roles at both the organization and project levels for precise access control. + + - Ensure flexibility and security by carefully planning role assignments. + +- **Billing management**: + - Billing is consolidated at the organization level, with detailed breakdowns available for each project. + +### Identity and Access Management (IAM) Roles + +TiDB Cloud provides role-based access control to manage permissions across organizations and projects: + +- **[Organization-Level roles](/tidb-cloud/manage-user-access.md#organization-roles)**: Grant permissions to manage the entire organization, including billing and project creation. + +- **[Project-Level roles](/tidb-cloud/manage-user-access.md#project-roles)**: Assign permissions to manage specific projects, including clusters and configurations. + +## Network access control + +TiDB Cloud ensures secure cluster connectivity and data transmission through robust network access controls. Key features include: + +### Private endpoints + +- Enables secure connectivity for SQL clients within your Virtual Private Cloud (VPC) to TiDB Cloud Dedicated clusters. + +- Supported by [AWS PrivateLink](/tidb-cloud/set-up-private-endpoint-connections.md) and [Google Cloud Private Service Connect](/tidb-cloud/set-up-private-endpoint-connections-on-google-cloud.md). + +**Best practices:** Use private endpoints in production to minimize public exposure and review configurations regularly. + +### TLS (Transport Layer Security) + +- Encrypts communication between clients and servers to secure data transmission. + +- Setup guides available for both [Serverless](/tidb-cloud/secure-connections-to-serverless-clusters.md) and [Dedicated](/tidb-cloud/tidb-cloud-tls-connect-to-dedicated.md) clusters. + +**Best practices:** Ensure TLS certificates are current and rotate them periodically. + +### VPC peering + +- Establishes private connections between Virtual Private Clouds, enabling secure, seamless communication. + +- For more information, see [Connect to TiDB Cloud Dedicated via VPC Peering](/tidb-cloud/set-up-vpc-peering-connections.md). + +**Best practices:** Use for critical workloads to avoid public internet exposure and monitor performance. + +### IP access list + +- Acts as a firewall to restrict cluster access to trusted IP addresses. + +- For more information, see [Configure an IP Access List](/tidb-cloud/configure-ip-access-list.md). + +**Best practices:** Regularly audit and update the access list to maintain security. + +## Data access control + +TiDB Cloud safeguards static data with advanced encryption capabilities, ensuring security and compliance with industry regulations. + +**Customer-Managed Encryption Key (CMEK)** + +- Provides organizations full control over encryption for Dedicated clusters. + +- Encrypts static data and backups with CMEK keys when enabled. + +- For TiDB Cloud Dedicated clusters without CMEK, TiDB Cloud uses escrow keys; TiDB Cloud Serverless clusters rely exclusively on escrow keys. + +**Best practices:** + +- Regularly rotate CMEK keys to enhance security and meet compliance standards. + +- Encrypt backups consistently with CMEK keys for added protection. + +- Leverage CMEK for industries requiring strict compliance, such as HIPAA and GDPR. + +For more information, see [Encryption at Rest Using Customer-Managed Encryption Keys](/tidb-cloud/tidb-cloud-encrypt-cmek.md). + +## Audit logging + +TiDB Cloud provides comprehensive audit logging to monitor user activities and database operations, ensuring security, accountability, and compliance. + +### Console audit logging + +Tracks key actions on the TiDB Cloud console, such as inviting users or managing clusters. + +**Best practices:** + +- Integrate logs with SIEM tools for real-time monitoring and alerts. + +- Set retention policies to meet compliance requirements. + +### Database audit logging + +Records detailed database operations, including executed SQL statements and user access. + +**Best practices:** + +- Regularly review logs for unusual activity or unauthorized access. + +- Use logs for compliance reporting and forensic analysis. + +For more information, see [Console Audit Logging](/tidb-cloud/tidb-cloud-console-auditing.md) and [Database Audit Logging](/tidb-cloud/tidb-cloud-auditing.md). \ No newline at end of file diff --git a/tidb-cloud/sql-concepts.md b/tidb-cloud/sql-concepts.md new file mode 100644 index 0000000000000..1a6a2d8c10f8d --- /dev/null +++ b/tidb-cloud/sql-concepts.md @@ -0,0 +1,94 @@ +--- +title: SQL +summary: Learn about SQL concepts for TiDB. +--- + +# SQL + +TiDB is highly compatible with the MySQL protocol and the common features and syntax of MySQL 5.7 and MySQL 8.0. The ecosystem tools for MySQL (PHPMyAdmin, Navicat, MySQL Workbench, DBeaver and [more](https://docs.pingcap.com/tidb/v7.2/dev-guide-third-party-support#gui)) and the MySQL client can be used for TiDB. + +However, some features of MySQL are not supported in TiDB. This could be because there is now a better way to solve the problem (such as the use of JSON instead of XML functions) or a lack of current demand versus effort required (such as stored procedures and functions). Additionally, some features might be difficult to implement in a distributed system. For more information, see [MySQL Compatibility](/mysql-compatibility.md). + +## SQL statements + +A SQL statement is a command or instruction in SQL (Structured Query Language) composed of identifiers, parameters, variables, data types, and reserved SQL keywords. It directs the database to perform specific actions, such as retrieving, modifying, or managing data and database structures. + +TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensions for MySQL and TiDB-specific statements where necessary. + +SQL is divided into the following 4 types according to their functions: + +- DDL (Data Definition Language): It is used to define database objects, including databases, tables, views, and indexes. For DDL statements in TiDB, see [Schema management / Data definition statements (DDL)](/sql-statements/sql-statement-overview.md#schema-management--data-definition-statements-ddl). + +- DML (Data Manipulation Language): It is used to manipulate application related records. For DML statements in TiDB, see [Data manipulation statements (DML)](/sql-statements/sql-statement-overview.md#data-manipulation-statements-dml). + +- DQL (Data Query Language): It is used to query the records after conditional filtering. + +- DCL (Data Control Language): It is used to define access privileges and security levels. + +To get an overview of SQL statements in TiDB, see [SQL Statement Overview](/sql-statements/sql-statement-overview.md). + +## SQL mode + +TiDB servers operate in different SQL modes and apply these modes differently for different clients. SQL mode defines the SQL syntax that TiDB supports and the type of data validation check to perform. + +For more information, see [SQL Mode](/sql-mode.md). + +## Row ID generation attributes + +TiDB provides three SQL attributes to optimize row ID generation and data distribution to address performance and scalability challenges. + +- AUTO_INCREMENT + +- AUTO_RANDOM + +- SHARD_ROW_ID_BITS + +### AUTO_INCREMENT + +`AUTO_INCREMENT` is a column attribute that is used to automatically fill in default column values. When the `INSERT` statement does not specify values for the `AUTO_INCREMENT` column, the system automatically assigns values to this column. + +For performance reasons, `AUTO_INCREMENT` numbers are allocated in a batch of values (30 thousand by default) to each TiDB server. This means that while `AUTO_INCREMENT` numbers are guaranteed to be unique, values assigned to an `INSERT` statement will only be monotonic on a per TiDB server basis. + +If you want the `AUTO_INCREMENT` numbers to be monotonic on all TiDB servers and your TiDB version is v6.5.0 or later, it is recommended to enable the [MySQL compatibility mode](/auto-increment.md#mysql-compatibility-mode). + +For more information, see [AUTO_INCREMENT](/auto-increment.md). + +### AUTO_RANDOM + +`AUTO_RANDOM` is a column attribute that is used to automatically assign values to a `BIGINT` column. Values assigned automatically are random and unique. Since the value of `AUTO_RANDOM` is random and unique, `AUTO_RANDOM` is often used in place of [`AUTO_INCREMENT`](/auto-increment.md) to avoid write hotspot in a single storage node caused by TiDB assigning consecutive IDs. + +Since the value of `AUTO_RANDOM` is random and unique, `AUTO_RANDOM` is often used in place of [`AUTO_INCREMENT`](/auto-increment.md)to avoid write hotspot in a single storage node caused by TiDB assigning consecutive IDs. If the current `AUTO_INCREMENT` column is a primary key and the type is `BIGINT`, you can execute the `ALTER TABLE t MODIFY COLUMN id BIGINT AUTO_RANDOM(5);` statement to switch from `AUTO_INCREMENT` to `AUTO_RANDOM`. + +For more information, see [AUTO_RANDOM](/auto-random.md). + +### SHARD_ROW_ID_BITS + +For the tables with a non-clustered primary key or no primary key, TiDB uses an implicit auto-increment row ID. When a large number of `INSERT` operations are performed, the data is written into a single Region, causing a write hot spot. + +To mitigate the hot spot issue, you can configure [`SHARD_ROW_ID_BITS`](/shard-row-id-bits.md). The row IDs are scattered and the data are written into multiple different Regions. + +## Keywords + +Keywords are words that have special meanings in SQL statements, such as `SELECT`, `UPDATE`, and `DELETE`. + +- Some of them can be used as identifiers directly, which are called non-reserved keywords. + +- Some of them require special treatment before being used as identifiers, which are called reserved keywords. + +However, there are special non-reserved keywords that might still require special treatment. It is recommended that you treat them as reserved keywords. + +For more information, see [Keywords](/keywords.md). + +## User-defined variables + +TiDB lets you set and read the user-defined variables. The format of the user-defined variables is `@var_name`. The characters that compose `var_name` can be any characters that can compose an identifier, including the numbers `0-9`, the letters `a-zA-Z`, the underscore `_`, the dollar sign `$`, and the UTF-8 characters. In addition, it also includes the English period `.`. The user-defined variables are case-insensitive. + +The user-defined variables are session-specific, which means a user variable defined by one client connection cannot be seen or used by other client connections. + +For more information, see [User-Defined Variables](/user-defined-variables.md). + +## Metadata lock + +In TiDB, a metadata lock is a mechanism introduced to manage changes to table metadata during online schema changes. When a transaction begins, it locks onto a snapshot of the current metadata. If the metadata changes during the transaction, TiDB throws an "Information schema is changed" error, preventing the transaction from committing. The metadata lock coordinates Data Manipulation Language (DML) and Data Definition Language (DDL) operations by prioritizing DMLs, ensuring that in-progress DML transactions with outdated metadata commit before applying new DDL changes, thus minimizing errors and maintaining data consistency. + +For more information, see [Metadata Lock](/metadata-lock.md). \ No newline at end of file diff --git a/tidb-cloud/transaction-concepts.md b/tidb-cloud/transaction-concepts.md new file mode 100644 index 0000000000000..e5e04a7fe1d99 --- /dev/null +++ b/tidb-cloud/transaction-concepts.md @@ -0,0 +1,39 @@ +--- +title: Transactions +summary: Learn about transactions concepts for TiDB Cloud. +--- + +# Transactions + +TiDB provides complete distributed transactions and the model has some optimizations on the basis of [Google Percolator](https://research.google.com/pubs/pub36726.html). + +## Optimistic transaction mode + +TiDB's optimistic transaction model does not detect conflicts until the commit phase. If there are conflicts, the transaction needs retry. But this model is inefficient if the conflict is severe, because operations before retry are invalid and need to repeat. + +Assume that the database is used as a counter. High access concurrency might lead to severe conflicts, resulting in multiple retries or even timeouts. Therefore, in the scenario of severe conflicts, it is recommended to use the pessimistic transaction mode or to solve problems at the system architecture level, such as placing counter in Redis. Nonetheless, the optimistic transaction model is efficient if the access conflict is not very severe. + +For more information, see [TiDB Optimistic Transaction Model](/optimistic-transaction.md). + +## Pessimistic transaction mode + +In TiDB, the pessimistic transaction mode has almost the same behavior as in MySQL. The transaction applies a lock during the execution phase, which avoids retries in conflict situations and ensures a higher success rate. By applying the pessimistic locking, you can also lock data in advance using `SELECT FOR UPDATE`. + +However, if the application scenario has fewer conflicts, the optimistic transaction model has better performance. +For more information, see [TiDB Pessimistic Transaction Mode](/pessimistic-transaction.md). + +## Transaction isolation levels + +Transaction isolation is one of the foundations of database transaction processing. Isolation is one of the four key properties of a transaction (commonly referred as [ACID](/tidb-cloud/tidb-cloud-glossary.md#acid)). + +TiDB implements Snapshot Isolation (SI) consistency, which it advertises as `REPEATABLE-READ` for compatibility with MySQL. This differs from the [ANSI Repeatable Read isolation level](/transaction-isolation-levels.md#difference-between-tidb-and-ansi-repeatable-read) and the [MySQL Repeatable Read level](/transaction-isolation-levels.md#difference-between-tidb-and-mysql-repeatable-read). + +For more information, see [TiDB Transaction Isolation Levels](/transaction-isolation-levels.md). + +## Non-transactional DML statements + +A non-transactional DML statement is a DML statement split into multiple SQL statements (which is, multiple batches) to be executed in sequence. It enhances the performance and ease of use in batch data processing at the expense of transactional atomicity and isolation. + +Usually, memory-consuming transactions need to be split into multiple SQL statements to bypass the transaction size limit. Non-transactional DML statements integrate this process into the TiDB kernel to achieve the same effect. It is helpful to understand the effect of non-transactional DML statements by splitting SQL statements. The `DRY RUN` syntax can be used to preview the split statements. + +For more information, see [Non-Transactional DML Statements](/non-transactional-dml.md). \ No newline at end of file