Skip to content

Commit

Permalink
*: update doc for generated columns GA (pingcap#13246)
Browse files Browse the repository at this point in the history
  • Loading branch information
ran-huang authored Apr 21, 2023
1 parent 54fc679 commit beef519
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions develop/dev-guide-create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Column definitions typically take the following form.

- `{column_name}`: The column name.
- `{data_type}`: The column [data type](/data-type-overview.md).
- `{column_qualification}`: Column qualifications, such as **column-level constraints** or [generated column (experimental feature)](/generated-columns.md) clauses.
- `{column_qualification}`: Column qualifications, such as **column-level constraints** or [generated column](/generated-columns.md) clauses.

You can add some columns to the `users` table, such as the unique identifier `id`, `balance` and `nickname`.

Expand Down Expand Up @@ -102,7 +102,7 @@ A [primary key](/constraints.md#primary-key) is a column or a set of columns in

> **Note:**
>
> The default definition of **primary key** in TiDB is different from that in [InnoDB](https://mariadb.com/kb/en/innodb/)(the common storage engine of MySQL).
> The default definition of **primary key** in TiDB is different from that in [InnoDB](https://dev.mysql.com/doc/refman/8.0/en/innodb-storage-engine.html)(the common storage engine of MySQL).
>
> - In **InnoDB**: A **primary key** is unique, not null, and **index clustered**.
>
Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-schema-design-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TiDB comes with a default database named `test`. However, it is recommended that

A table is a collection of related data in a [database](#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 (experimental feature)](/generated-columns.md).
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).

### Index

Expand All @@ -40,7 +40,7 @@ There are two common types of indexes:

> **Note:**
>
> In TiDB, the default definition of **Primary Key** is different from that in [InnoDB](https://mariadb.com/kb/en/innodb/) (a common storage engine of MySQL).
> In TiDB, the default definition of **Primary Key** is different from that in [InnoDB](https://dev.mysql.com/doc/refman/8.0/en/innodb-storage-engine.html) (a common storage engine of MySQL).
>
> - In InnoDB, the definition of **Primary Key** is unique, not null, and a **clustered index**.
> - In TiDB, the definition of **Primary Key** is unique and not null. But the primary key is not guaranteed to be a **clustered index**. To specify whether the primary key is a clustered index, you can add non-reserved keywords `CLUSTERED` or `NONCLUSTERED` after `PRIMARY KEY` in a `CREATE TABLE` statement. If a statement does not explicitly specify these keywords, the default behavior is controlled by the system variable `@@global.tidb_enable_clustered_index`. For more information, see [Clustered Indexes](/clustered-indexes.md).
Expand Down
4 changes: 0 additions & 4 deletions generated-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ aliases: ['/docs/dev/generated-columns/','/docs/dev/reference/sql/generated-colu

# Generated Columns

> **Warning:**
>
> This is still an experimental feature. It is **NOT** recommended that you use it in the production environment.
This document introduces the concept and usage of generated columns.

## Basic concepts
Expand Down
4 changes: 2 additions & 2 deletions time-to-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ You can use TTL together with [default values of the data types](/data-type-defa

### TTL and generated columns

You can use TTL together with [generated columns](/generated-columns.md) (experimental feature) to configure complex expiration rules. For example:
You can use TTL together with [generated columns](/generated-columns.md) to configure complex expiration rules. For example:

```sql
CREATE TABLE message (
Expand Down Expand Up @@ -252,7 +252,7 @@ Currently, the TTL feature has the following limitations:
* A table with the TTL attribute does not support being referenced by other tables as the primary table in a foreign key constraint.
* It is not guaranteed that all expired data is deleted immediately. The time when expired data is deleted depends on the scheduling interval and scheduling window of the background cleanup job.
* For tables that use [clustered indexes](/clustered-indexes.md), if the primary key is neither an integer nor a binary string type, the TTL job cannot be split into multiple tasks. This will cause the TTL job to be executed sequentially on a single TiDB node. If the table contains a large amount of data, the execution of the TTL job might become slow.
* TTL is not available for [TiDB Cloud Serverless Tier](https://docs.pingcap.com/tidbcloud/select-cluster-tier#serverless-tier-beta).
* TTL is not available for [TiDB Cloud Serverless Tier](https://docs.pingcap.com/tidbcloud/select-cluster-tier#serverless-tier-beta).

## FAQs

Expand Down

0 comments on commit beef519

Please sign in to comment.