diff --git a/TOC.md b/TOC.md index b1d8364fa26ff..5baba7383a315 100644 --- a/TOC.md +++ b/TOC.md @@ -7,6 +7,7 @@ + About TiDB + [TiDB Introduction](/overview.md) + + [What's New in TiDB 5.0](/releases/release-5.0.0-rc.md) + [Basic Features](/basic-features.md) + Benchmarks + [Interaction Test on Online Workloads and `ADD INDEX`](/benchmark/online-workloads-and-add-index-operations.md) @@ -513,6 +514,8 @@ + Release Notes + [All Releases](/releases/release-notes.md) + [TiDB Roadmap](/roadmap.md) + + v5.0 + + [5.0.0-rc](/releases/release-5.0.0-rc.md) + v4.0 + [4.0.9](/releases/release-4.0.9.md) + [4.0.8](/releases/release-4.0.8.md) diff --git a/_index.md b/_index.md index d3a5ea54d87a6..babb8a0d3802b 100644 --- a/_index.md +++ b/_index.md @@ -15,7 +15,7 @@ Designed for the cloud, TiDB provides flexible scalability, reliability and secu - [TiDB Introduction](/overview.md) - [Basic Features](/basic-features.md) -- [What's New in TiDB 4.0](/whats-new-in-tidb-4.0.md) +- [What's New in TiDB 5.0](/releases/release-5.0.0-rc.md) - [Compatibility with MySQL](/mysql-compatibility.md) - [Usage Limitations](/tidb-limitations.md) - [TiDB Adopters](/adopters.md) diff --git a/clustered-indexes.md b/clustered-indexes.md index 69f00ea283e2e..9ee8bedc50980 100644 --- a/clustered-indexes.md +++ b/clustered-indexes.md @@ -5,7 +5,7 @@ summary: Learn how clustered indexes apply to TiDB. # Clustered Indexes -The clustered index is an experimental feature introduced in TiDB 5.0.0-rc. This document provides multiple examples to explain how this feature makes a difference to the query performance of TiDB. To enable this feature and see the detailed operation guide, see [tidb_enable_clustered_index](/system-variables.md#tidb_enable_clustered_index). +The clustered index is an experimental feature introduced in TiDB 5.0.0-rc. This document provides multiple examples to explain how this feature makes a difference to the query performance of TiDB. To enable this feature and see the detailed operation guide, see [tidb_enable_clustered_index](/system-variables.md#tidb_enable_clustered_index-new-in-v500-rc). Clustered indexes provide TiDB the ability to organize tables in a way that can improve the performance of certain queries. The term _clustered_ in this context 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). diff --git a/log-redaction.md b/log-redaction.md index af72f8cc44ae1..588ec122d695c 100644 --- a/log-redaction.md +++ b/log-redaction.md @@ -43,4 +43,4 @@ To enable log redaction in the TiKV side, set the value of [`security.redact-inf ## Log redaction in PD side -To enable log redaction in the PD side, set the value of [`security.redact-info-log`](/pd-configuration-file.md#redact-info-log) to `true`. This configuration value defaults to `false`, which means that log redaction is disabled. +To enable log redaction in the PD side, set the value of [`security.redact-info-log`](/pd-configuration-file.md#redact-info-log-new-in-v500-rc) to `true`. This configuration value defaults to `false`, which means that log redaction is disabled. diff --git a/pd-configuration-file.md b/pd-configuration-file.md index 40b56f982c363..5edd6abd03eb0 100644 --- a/pd-configuration-file.md +++ b/pd-configuration-file.md @@ -142,7 +142,7 @@ Configuration items related to security + The path of the PEM file that contains the X509 key + Default value: "" -### `redact-info-log` +### `redact-info-log` New in v5.0.0-rc + Controls whether to enable log redaction in the PD log. + When you set the configuration value to `true`, user data is redacted in the PD log. @@ -314,7 +314,7 @@ Configuration items related to scheduling + Determines the maximum number of operations related to adding peers within a minute + Default value: `15` -### `enable-joint-consensus` +### `enable-joint-consensus` New in v5.0.0-rc > **Warning:** > diff --git a/releases/release-5.0.0-rc.md b/releases/release-5.0.0-rc.md new file mode 100644 index 0000000000000..405125345839d --- /dev/null +++ b/releases/release-5.0.0-rc.md @@ -0,0 +1,189 @@ +--- +title: TiDB 5.0 RC Release Notes +--- + +# TiDB 5.0 RC Release Notes + +Release date: January 12, 2021 + +TiDB version: 5.0.0-rc + +TiDB v5.0.0-rc is the predecessor version of TiDB v5.0. In v5.0, PingCAP will be dedicated to helping enterprises quickly build applications based on TiDB, freeing them from worries about database performance, performance jitter, security, high availability, disaster recovery, troubleshooting SQL performance, and so on. + +In v5.0, the key new features or improvements are as follows: + ++ Clustered index. When this feature is enabled, database performance is improved. For example, in the TPC-C tpmC test, TiDB's performance, with clustered index enabled, improves by 39%. ++ Asynchronous commit or async commit. When this feature is enabled, the write latency is reduced. For example, in the Sysbench olpt-insert test, the write latency of TiDB, with async commit enabled, is reduced by 37.3%. ++ Reduced jitters. This is achieved by improving the optimizer stability and by limiting system tasks' usages of I/O, network, CPU, and memory resources. For example, in the 72-hour performance test, the standard deviation of Sysbench TPS jitter is reduced from 11.09% to 3.36%. ++ Raft Join Consensus algorithm, which ensures the system availability during the Region membership change. ++ Optimized `EXPLAIN` features and invisible index, which helps Database Administrators (DBAs) debug SQL statements more efficiently. ++ Guaranteed reliability for enterprise data. You can back up data from TiDB to AWS S3 storage and Google Cloud GCS, or restore data from these cloud storage platforms. ++ Improved performance of data import from or data export to AWS S3 storage or TiDB/MySQL, which helps enterprises quickly build applications on the cloud. For example, in the TPC-C test, the performance of importing 1 TiB data improves by 40%, from 254 GiB/h to 366 GiB/h. + +## SQL + +### Support clustered index (experimental) + +When the clustered index feature is enabled, TiDB performance improves significantly (for example in the TPC-C tpmC test, TiDB's performance, with clustered index enabled, improves by 39%) in the following cases: + ++ When data is inserted, the clustered index reduces one write of the index data from the network. ++ When a query with an equivalent condition only involves the primary key, the clustered index reduces one read of index data from the network. ++ When a query with a range condition only involves the primary key, the clustered index reduces multiple reads of index data from the network. ++ When a query with an equivalent or range condition involves the primary key prefix, the clustered index reduces multiple reads of index data from the network. + +Clustered index defines the physical storage order of data in a table. The data in the table is sorted only according to the definition of the clustered index. Each table has only one clustered index. + +Users can enable the clustered index feature by modifying the `tidb_enable_clustered_index` variable. When enabled, the feature takes effect only on newly created tables and applies to the primary key that has multiple columns or is non-integer types in a single column. If the primary key is an integer type in a single column, or if the table has no primary key, the data is sorted in the same way as before, without being affected by the clustered index. + +For example, to check whether a table (`tbl_name`) has a clustered index, execute `select tidb_pk_type from information_schema.tables where tbl_name = '{tbl_name}'`. + ++ [User document](/system-variables.md#tidb_enable_clustered_index-new-in-v500-rc) ++ Related issue: [#4841](https://github.com/pingcap/tidb/issues/4841) + +### Support invisible indexes + +When users tune performance or select optimal indexes, they can set an index to be `Visible` or `Invisible` by using SQL statements. This setting can avoid performing resource-consuming operations, such as `DROP INDEX` and `ADD INDEX`. + +To modify the visibility of an index, use the `ALTER INDEX` statement. After the modification, the optimizer decides whether to add this index to the index list based on the index visibility. + ++ [User document](/sql-statements/sql-statement-alter-index.md) ++ Related issue: [#9246](https://github.com/pingcap/tidb/issues/9246) + +### Support `EXCEPT` and `INTERSECT` operators + +The `INTERSECT` operator is a set operator, which returns the intersection of the result sets of two or more queries. To some extent, it is an alternative to the `InnerJoin` operator. + +The `EXCEPT` operator is a set operator, which combines the result sets of two queries and returns elements that are in the first query result but not in the second. + ++ [User document](/functions-and-operators/set-operators.md) ++ Related issue: [#18031](https://github.com/pingcap/tidb/issues/18031) + +## Transaction + +### Increase the success rate of executing pessimistic transactions + +In the pessimistic transaction mode, if the tables involved in a transaction contain concurrent DDL operations or `SCHEMA VERSION` changes, the system automatically updates the transaction's `SCHEMA VERSION` to the latest to avoid the transaction being interrupted by DDL operations and to ensure the successful transaction commit. If the transaction is interrupted, the client receives the `Information schema is changed` error message. + ++ [User document](/system-variables.md#tidb_enable_amend_pessimistic_txn-new-in-v407) ++ Related issue: [#18005](https://github.com/pingcap/tidb/issues/18005) + +## Character set and collation + +Support case-insensitive comparison sort for character sets. + ++ [User document](/character-set-and-collation.md#new-framework-for-collations) ++ Related issue: [#17596](https://github.com/pingcap/tidb/issues/17596) + +## Security + +### Support desensitizing error messages and log files + +TiDB now supports desensitizing error messages and log files to avoid leaking sensitive information such as ID information and credit card number. + +Users can enable the desensitization feature for different components: + ++ For the TiDB side, set the `tidb_redact_log=1` variable using SQL statements in tidb-server. ++ For the TiKV side, set the `security.redact-info-log = true` configuration in tikv-server. ++ For the PD side, set the `security.redact-info-log = true` configuration in pd-server. [#2852](https://github.com/tikv/pd/issues/2852) [#3011](https://github.com/tikv/pd/pull/3011) ++ For the TiFlash side, set the `security.redact_info_log = true` configuration in tiflash-server and set `security.redact-info-log = true` in tiflash-learner. + +[User document](/log-redaction.md) + +Related issue: [#18566](https://github.com/pingcap/tidb/issues/18566) + +## Performance improvements + +### Support async commit (experimental) + +Enabling the async commit feature can significantly reduce the latency of transactions. For example, with this feature enabled, the latency of transactions in the Sysbench oltp-insert test is 37.3% lower than that when this feature is disabled. + +Previously without the async commit feature, the statements being written were only returned to the client after the two-phase transaction commit finished. Now the async commit feature supports returning the result to the client after the first phase of the two-phase commit finishes. The second phase is then performed asynchronously in the background, thus reducing the latency of transaction commit. + +However, when async commit is enabled, the external consistency of transactions can be guaranteed **only** when `tidb_guarantee_external_consistency = ON` is set. With async commit enabled, the performance might drop. + +Users can enable this feature by setting the global variable `tidb_enable_async_commit = ON`. + ++ [User document](/system-variables.md#tidb_enable_async_commit-new-in-v500-rc) ++ Related issue: [#8316](https://github.com/tikv/tikv/issues/8316) + +### Improve the optimizer's stability in index selection (experimental) + +The optimizer's ability to always select a relatively suitable index greatly determines whether the latency of queries is stable. We have improved and refactored the statistics module to ensure that, for the same SQL statements, the optimizer does not select a different index from multiple candidate indexes each time due to missing or inaccurate statistics. The main improvements to help the optimizer select a relatively suitable index are as follows: + ++ Add more information to the statistics module, such as the multi-column NDV, the multi-column order dependency, and the multi-column function dependency. ++ Refactor the statistics module. + + Delete `TopN` values from `CMSKetch`. + + Refactor the search logic of `TopN`. + + Delete the `TopN` information from the histogram and create an index of the histogram for easy maintenance of Bucket NDV. + +Related issue: [#18065](https://github.com/pingcap/tidb/issues/18065) + +### Optimize performance jitter caused by imperfect scheduling or imperfect I/O flow control + +The TiDB scheduling process occupies resources such as I/O, network, CPU, and memory. If TiDB does not control the scheduled tasks, QPS and delay might cause performance jitter due to resource preemption. After the following optimizations, in the 72-hour test, the standard deviation of Sysbench TPS jitter is reduced from 11.09% to 3.36%. + ++ Reduce the scheduling issues caused by fluctuations of node capacity (always near the waterline) and caused by PD's `store-limit` configuration value set too large. This is achieved by introducing a new set of scheduling calculation formulas enabled via the `region-score-formula-version = v2` configuration item. [#3269](https://github.com/tikv/pd/pull/3269) ++ Enable the cross-Region merge feature by modifying `enable-cross-table-merge = true` to reduce the number of empty Regions. [#3129](https://github.com/tikv/pd/pull/3129) ++ Data compaction in the TiKV background occupies a lot of I/O resources. The system automatically adjusts the compaction rate to balance the contention for I/O resources between background tasks and foreground reads and writes. After enabling this feature via the `rate-limiter-auto-tuned` configuration item, the delay jitter is greatly reduced. [#18011](https://github.com/pingcap/tidb/issues/18011) ++ When TiKV performs garbage collection (GC) and data compaction, partitions occupy CPU and I/O resources. Overlapping data exists during the execution of these two tasks. To reduce I/O usage, the GC Compaction Filter feature combines these two tasks into one and executes them in the same task. This feature is still experimental and you can enable it via `gc.enable-compaction-filter = ture`. [#18009](https://github.com/pingcap/tidb/issues/18009) ++ When TiFlash compresses or sorts data, it occupies a lot of I/O resources. The system alleviates contention for resources by limiting the compression and data sorting's use of I/O resources. This feature is still experimental and you can enable it via `bg_task_io_rate_limit`. + +Related issue: [#18005](https://github.com/pingcap/tidb/issues/18005) + +### Improve the stability of TiFlash in Real-time BI / Data Warehousing scenarios + ++ Limit the memory usage of DeltaIndex to avoid system out of memory (OOM) caused by excessive memory usage in the scenarios of huge data volume. ++ Limit the I/O write traffic used by the background data sorting task to reduce the impact on the foreground tasks. ++ Add new thread pools to queue coprocessor tasks, which avoids system OOM caused by excessive memory usage when processing coprocessors in high concurrency. + +### Other performance optimizations + ++ Improve the execution performance of `delete * from table where id +### last_plan_from_binding New in v5.0.0-rc - Scope: SESSION - Default value: 0 @@ -303,7 +303,7 @@ Constraint checking is always performed in place for pessimistic transactions (d - Default value: 0 - This variable is used to control whether to enable the cascades planner, which is currently considered experimental. -### tidb_enable_clustered_index +### tidb_enable_clustered_index New in v5.0.0-rc - Scope: SESSION | GLOBAL - Default value: 0 @@ -975,7 +975,7 @@ explain select * from t where age=5; - TiDB triggers an alarm when the percentage of the memory it takes exceeds a certain threshold. For the detailed usage description of this feature, see [`memory-usage-alarm-ratio`](/tidb-configuration-file.md#memory-usage-alarm-ratio-new-in-v409). - You can set the initial value of this variable by configuring [`memory-usage-alarm-ratio`](/tidb-configuration-file.md#memory-usage-alarm-ratio-new-in-v409). -### `tidb_track_aggregate_memory_usage` +### `tidb_track_aggregate_memory_usage` New in v5.0.0-rc > **Warning:** > @@ -985,14 +985,14 @@ explain select * from t where age=5; - Default value: OFF - This variable controls whether to track the memory usage of the aggregate function. When you enable this feature, TiDB counts the memory usage of the aggregate function, which might cause the overall SQL memory statistics to exceed the threshold [`mem-quota-query`](/tidb-configuration-file.md#mem-quota-query), and then be affected by the behavior defined by [`oom-action`](/tidb-configuration-file.md#oom-action). -### `tidb_enable_async_commit` +### `tidb_enable_async_commit` New in v5.0.0-rc > **Warning:** > > Async commit is still an experimental feature. It is not recommended to use this feature in the production environment. Currently, the following incompatible issues are found, and be aware of them if you need to use this feature: > - This feature is incompatible with [TiCDC](/ticdc/ticdc-overview.md) and might cause TiCDC to run abnormally. -> - This feature is incompatible with [Compaction Filter](/tikv-configuration-file.md#enable-compaction-filter). If you use the two features at the same time, write loss might occur. +> - This feature is incompatible with [Compaction Filter](/tikv-configuration-file.md#enable-compaction-filter-new-in-v500-rc). If you use the two features at the same time, write loss might occur. > - This feature is incompatible with TiDB Binlog and does not take effect when TiDB Binlog is enabled. - Scope: SESSION | GLOBAL @@ -1001,9 +1001,9 @@ explain select * from t where age=5; > **Warning:** > -> When async commit is enabled, the external consistency of transactions cannot be guaranteed. For details, refer to [`tidb_guarantee_external_consistency`](#tidb_guarantee_external_consistency). +> When async commit is enabled, the external consistency of transactions cannot be guaranteed. For details, refer to [`tidb_guarantee_external_consistency`](#tidb_guarantee_external_consistency-new-in-v500-rc). -### `tidb_guarantee_external_consistency` +### `tidb_guarantee_external_consistency` New in v5.0.0-rc - Scope: SESSION | GLOBAL - Default value: OFF diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 1cd7cb4f5f6ee..c071a1834f3e6 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -309,7 +309,7 @@ Configuration items related to performance. - Default value: `5000` - If a transaction does not roll back or commit after the number of statements exceeds `stmt-count-limit`, TiDB returns the `statement count 5001 exceeds the transaction limitation, autocommit = false` error. This configuration takes effect **only** in the retriable optimistic transaction. If you use the pessimistic transaction or have disabled the transaction retry, the number of statements in a transaction is not limited by this configuration. -### `txn-entry-size-limit` +### `txn-entry-size-limit` New in v5.0.0-rc - The size limit of a single row of data in TiDB. - Default value: `6291456` (in bytes) @@ -462,7 +462,7 @@ The Plan Cache configuration of the `PREPARE` statement. - The threshold of the TiKV load. If the TiKV load exceeds this threshold, more `batch` packets are collected to relieve the pressure of TiKV. It is valid only when the value of `tikv-client.max-batch-size` is greater than `0`. It is recommended not to modify this value. - Default value: `200` -## tikv-client.async-commit +## tikv-client.async-commit New in v5.0.0-rc ### `keys-limit` diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index e6c8809b00acc..36f280aaaf0b8 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -749,7 +749,7 @@ Configuration items related to RocksDB + Minimum value: `1` + Maximum value: `3` -### `rate-limiter-auto-tuned` +### `rate-limiter-auto-tuned` New in v5.0.0-rc + Determines whether to automatically optimize the configuration of the RocksDB's compaction rate limiter based on recent workload. When this configuration is enabled, compaction pending bytes will be slightly higher than usual. + Default value: `true` @@ -1247,7 +1247,7 @@ Configuration items related to TiDB Lightning import and BR restore. ## gc -### `enable-compaction-filter` +### `enable-compaction-filter` New in v5.0.0-rc + Controls whether to enable the GC in Compaction Filter feature + Default value: `false`