Skip to content

Conversation

@TomShawn
Copy link
Contributor

@TomShawn TomShawn commented Jun 19, 2020

What is changed, added or deleted? (Required)

Introduce invisible index.

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

@TomShawn TomShawn added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. special-week PR from Document Special Week. v5.0 This PR/issue applies to TiDB v5.0. labels Jun 19, 2020
@TomShawn TomShawn requested review from AilinKid and yikeke June 19, 2020 08:13
@yikeke yikeke requested review from CaitinChen and zimulala and removed request for yikeke June 19, 2020 08:36
@yikeke
Copy link
Contributor

yikeke commented Jun 22, 2020

Please help review this PR. @CaitinChen

TomShawn and others added 2 commits June 23, 2020 10:21
Co-authored-by: Caitin <34535727+CaitinChen@users.noreply.github.com>
Co-authored-by: Caitin <34535727+CaitinChen@users.noreply.github.com>
@TomShawn
Copy link
Contributor Author

@CaitinChen Comments address, PTAL again, thanks!

Copy link
Contributor

@CaitinChen CaitinChen left a comment

Choose a reason for hiding this comment

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

LGTM

@TomShawn
Copy link
Contributor Author

@AilinKid PTAL

Comment on lines +197 to +198
## See also
Copy link

Choose a reason for hiding this comment

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

There is a MySQL compatibility difference in TiDB that should be documented. Because TiDB does not support the optimizer_switch, the following test case would allow the index to be used in MySQL - but will not work in TiDB:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
 id INT NOT NULL PRIMARY KEY auto_increment,
 b INT NOT NULL,
 INDEX (b) INVISIBLE
);

INSERT INTO t1 VALUES (1, 1), (2,2),(3,3),(4,4),(5,5);
SELECT SLEEP(1);
ANALYZE TABLE t1;
SET optimizer_switch="use_invisible_indexes=on";
EXPLAIN SELECT * FROM t1 WHERE b = 3;

Copy link
Contributor

@yikeke yikeke Jun 29, 2020

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, @wwar, we'll document this difference.

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@TomShawn
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 30, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 31d00be into pingcap:master Jun 30, 2020
@ghost ghost mentioned this pull request Jul 6, 2020
@TomShawn TomShawn deleted the alter-indexx branch September 4, 2020 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

special-week PR from Document Special Week. status/can-merge Indicates a PR has been approved by a committer. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. v5.0 This PR/issue applies to TiDB v5.0.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants