-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
system-variables: Merge with tidb-specific-sysvars #3152
Conversation
This merges the two documents together.
This has been updated to resolve conflicts from #3215, and is ready for review. |
@kissmydb, @yikeke, @SunRunAway, @zz-jason, PTAL. |
Note for the reviewers: shard-row-id-bits.md is added back as a table attribute in #3239 (under review). @kissmydb @zz-jason @SunRunAway |
- This variable is used to set whether to enable the `TABLE PARTITION` feature. | ||
- `off` indicates disabling the `TABLE PARTITION` feature. In this case, the syntax that creates a partition table can be executed, but the table created is not a partitioned one. | ||
- `on` indicates enabling the `TABLE PARTITION` feature for the supported partition types. Currently, it indicates enabling range partition, hash partition and range column partition with one single column. | ||
- `auto` functions the same way as `on` does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that we have removed the auto
value in TiDB 4.0.0, am I correct? @tiancaiamao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still seems to work when I set it:
mysql> show global variables like 'tidb_enable_table_partition';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| tidb_enable_table_partition | on |
+-----------------------------+-------+
1 row in set (0.01 sec)
mysql> set global tidb_enable_table_partition='auto';
Query OK, 0 rows affected (0.02 sec)
mysql> show global variables like 'tidb_enable_table_partition';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| tidb_enable_table_partition | auto |
+-----------------------------+-------+
1 row in set (0.00 sec)
- Default value: `2` | ||
- Controls the format version of the newly saved data in the table. In TiDB v4.0, the [new storage row format](https://github.com/pingcap/tidb/blob/master/docs/design/2018-07-19-row-format.md) version `2` is used by default to save new data. | ||
- If you upgrade from a TiDB version earlier than 4.0.0 to 4.0.0, the format version is not changed, and TiDB continues to use the old format of version `1` to write data to the table, which means that **only newly created clusters use the new data format by default**. | ||
- Note that modifying this variable does not affect the old data that has been saved, but applies the corresponding version format only to the newly written data after modifying this variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we safely set to a lower value in a newer versioned TiDB cluster? @coocood
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
See [TiDB Specific System Variables](/tidb-specific-system-variables.md). | ||
- Scope: SESSION | GLOBAL | ||
- Default value: ON | ||
- This variable controls whether to use the high precision mode when computing the window functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SunRunAway Could you help us to explain more on the computing difference between on
and off
? Would it execute faster when it's set to off
?
There are 3 comments outstanding, but these are actually not new (they existed before the refactor here). Is it possible that we can merge this, and then address in a followup PR? (I have some of my own critiques about some of the descriptions, but I am trying not to mix a refactor with too any changes.) |
That’s ok to me. |
Thanks! I have forked questions to #3260 - we can handle followup from there. |
@kissmydb PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #3261 |
Signed-off-by: ti-srebot <[email protected]>
What is changed, added or deleted? (Required)
This PR proposes merging the system-variables and tidb-specific-system-variables documents together.
The motivation for this, is that they both have the same semantics. It is just a namespace that differs, but this can clearly be visible by sorting the variables in alphabetical order (something else I've done.)
In the process of creating this PR, I discovered that several sysvars are undocumented. I have created #3155 to handle separately.
Also,
SHARD_ROW_ID_BITS
was documented as a system variable but it is not. I have moved it to the statement reference forCREATE TABLE
andALTER TABLE
.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
This is original work.