Skip to content
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

Merged
merged 17 commits into from Jul 14, 2020
Merged

system-variables: Merge with tidb-specific-sysvars #3152

merged 17 commits into from Jul 14, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 3, 2020

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 for CREATE TABLE and ALTER TABLE.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

This is original work.

@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Jul 3, 2020
@ghost ghost mentioned this pull request Jul 5, 2020
22 tasks
This merges the two documents together.
@ghost ghost marked this pull request as ready for review July 5, 2020 15:36
@TomShawn TomShawn requested a review from yikeke July 6, 2020 14:50
@TomShawn TomShawn added needs-cherry-pick-4.0 size/large Changes of a large size. translation/doing This PR's assignee is translating this PR. labels Jul 6, 2020
system-variables.md Outdated Show resolved Hide resolved
@ghost ghost mentioned this pull request Jul 10, 2020
5 tasks
@ghost
Copy link
Author

ghost commented Jul 10, 2020

This has been updated to resolve conflicts from #3215, and is ready for review.

@yikeke yikeke added the status/PTAL This PR is ready for reviewing. label Jul 10, 2020
@yikeke yikeke self-assigned this Jul 10, 2020
@ti-srebot
Copy link
Contributor

@kissmydb, @yikeke, @SunRunAway, @zz-jason, PTAL.

system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
@yikeke
Copy link
Contributor

yikeke commented Jul 13, 2020

Note for the reviewers: shard-row-id-bits.md is added back as a table attribute in #3239 (under review). @kissmydb @zz-jason @SunRunAway

system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
- 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.
Copy link
Member

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

Copy link
Author

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)

system-variables.md Show resolved Hide resolved
system-variables.md Show resolved Hide resolved
- 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.
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Yes

system-variables.md Outdated Show resolved Hide resolved
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.
Copy link
Member

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?

@ghost
Copy link
Author

ghost commented Jul 13, 2020

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.)

@zz-jason
Copy link
Member

That’s ok to me.
LGTM

@ghost ghost mentioned this pull request Jul 13, 2020
@ghost
Copy link
Author

ghost commented Jul 13, 2020

Thanks! I have forked questions to #3260 - we can handle followup from there.

@yikeke yikeke added status/LGT2 Indicates that a PR has LGTM 2. and removed status/PTAL This PR is ready for reviewing. labels Jul 14, 2020
@yikeke
Copy link
Contributor

yikeke commented Jul 14, 2020

@kissmydb PTAL

Copy link
Contributor

@kissmydb kissmydb left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT2 Indicates that a PR has LGTM 2. label Jul 14, 2020
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 14, 2020
@yikeke yikeke added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 14, 2020
@yikeke yikeke merged commit 7c3206d into pingcap:master Jul 14, 2020
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Jul 14, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3261

ti-srebot added a commit that referenced this pull request Jul 14, 2020
@yikeke yikeke assigned ran-huang and unassigned yikeke Jul 20, 2020
@ran-huang ran-huang added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR's assignee is translating this PR. labels Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. size/large Changes of a large size. status/LGT3 The PR has already had 3 LGTM. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants