sql: populate NotVisible to index definitions#84912
sql: populate NotVisible to index definitions#84912craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
6430488 to
e8a1396
Compare
e8a1396 to
607e729
Compare
607e729 to
54ed019
Compare
904601f to
dc4be74
Compare
This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: cockroachdb#72576 See also: cockroachdb#84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
6c75846 to
b56520e
Compare
This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: cockroachdb#72576 See also: cockroachdb#84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
b56520e to
25bad04
Compare
This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: cockroachdb#72576 See also: cockroachdb#84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
0f6fc6f to
d1c361b
Compare
This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: cockroachdb#72576 See also: cockroachdb#84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
d1c361b to
11fdc8a
Compare
84783: sql: add CREATE … NOT VISIBLE to parser r=wenyihu6 a=wenyihu6 This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: #72576 See also: #84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately. 84927: opt: permit coexistance of inv, forward histograms r=jordanlewis a=jordanlewis Closes #84529. Previously, when trying to use persisted histograms to filter an inverted column, if the histogram read from disk was a "forward histogram", the operation would fail with an internal error. This is because inverted histograms and forward histograms use different datatypes on disk, and it's not possible to compare a forward histogram (represented as the datatype of the column) with the inverted constraint (represented as DBytes). Now, this problem is corrected by making sure that we only store forward histogram data in forward histogram column sets, and likewise for inverted histogram data being only stored in inverted histogram column sets. Release note: None 85321: dev: a couple `testlogic` improvements r=rail a=rickystewart 1. Make sure `dev generate testlogic` is documented in `dev generate -h`. 2. Only default to running the sqlite logic tests if `--bigtest` is passed. 3. If a `--config` is passed, check whether the directory exists before running the test. This fixes cases like `dev testlogic --config=local-mixed-21.2-22.1` where not all logic test categories support the config. 4. Warn if no test directories are found. Release note: None Co-authored-by: wenyihu3 <wenyi.hu@cockroachlabs.com> Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com> Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
11fdc8a to
7bb42dc
Compare
michae2
left a comment
There was a problem hiding this comment.
Reviewed 15 of 15 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @mgartner, @rhu713, and @wenyihu6)
pkg/internal/sqlsmith/alter.go line 354 at r1 (raw file):
Inverted: inverted, Concurrently: s.coin(), NotVisible: s.d6() == 1, // NotVisible index is rare 1/6 chance.
Thank you for adding this!
pkg/sql/opt_catalog.go line 864 at r1 (raw file):
// Build the indexes. // TODO(wenyihu6): check if need to populate NotVisible property here
I don't think we need to put a NotVisible property into optIndex. All we need is for optIndex.IsNotVisible() to work, which it should, assuming IsNotVisible can be called on its idx.
pkg/sql/importer/read_import_mysql.go line 499 at r1 (raw file):
} // TODO(wenyihu6): support importing mysql CREATE TABLE statement with not // visible index.
Cool idea!
pkg/sql/randgen/schema.go line 205 at r1 (raw file):
// TODO(wenyihu6): check if we should support not visible index here // Creating a not visible unique index in table def here might cause error // in parseCreateStatement.
I think it's fine to leave not-visible indexes out of randgen for now.
7bb42dc to
8591cdd
Compare
|
Previously, michae2 (Michael Erickson) wrote…
That makes sense. 👍 |
8591cdd to
9ce15f4
Compare
mgartner
left a comment
There was a problem hiding this comment.
Reviewed 13 of 15 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @michae2, @rhu713, and @wenyihu6)
pkg/sql/randgen/schema.go line 205 at r1 (raw file):
Previously, michae2 (Michael Erickson) wrote…
I think it's fine to leave not-visible indexes out of randgen for now.
For now we could make not-visible non-unique indexes only.
pkg/sql/opt/xform/testdata/rules/not_visible_index line 10 at r2 (raw file):
exec-ddl SHOW CREATE t1
I think these tests belong better in pkg/sql/opt/testutils/testcat/testdata/index.
9ce15f4 to
a50aba2
Compare
|
Previously, mgartner (Marcus Gartner) wrote…
Done. |
|
Previously, mgartner (Marcus Gartner) wrote…
Done. |
a50aba2 to
2d912be
Compare
mgartner
left a comment
There was a problem hiding this comment.
Great work!
Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @michae2, @rhu713, and @wenyihu6)
This commit populates the field `NotVisible` for `IndexDescriptor`, `Tree.CreateIndex`, and `Tree.TableIndexDef` at different places. In order to add some test cases for this commit, I included a test case that checks the output of `SHOW CREATE` under `pkg/sql/opt/xform/testdata/rules/not_visible_index` to make sure that the field has been populated correctly. Creating invisible indexes under `pkg/sql/opt/testutils/testcat` no longer returns an unimplemented error. But executing `CREATE INDEX ... NOT VISIBLE` in logictests or in a cluster still returns an unimplemented error. See also: cockroachdb#84783 Assists: cockroachdb#72576 Release note: none
2d912be to
2524f94
Compare
|
Some GitHub CI failed due to |
michae2
left a comment
There was a problem hiding this comment.
Makes sense, thank you!
Reviewed 1 of 2 files at r2, 1 of 5 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @michae2, @rhu713, and @wenyihu6)
|
TFTR! Bazel failure (TestRules/combo, computed, cycle) is a known issue (irrelevant to this PR). bors r+ |
|
Build succeeded: |
This commit populates the field
NotVisibleforIndexDescriptor,Tree.CreateIndex, andTree.TableIndexDefat different places. In order toadd some test cases for this commit, I included a test case that checks the
output of
SHOW CREATEunderpkg/sql/opt/testutils/testcat/testdata/indexto make sure thatthe field has been populated correctly. Creating invisible indexes under
pkg/sql/opt/testutils/testcatno longer returns an unimplemented error. Butexecuting
CREATE INDEX ... NOT VISIBLEin logictests or in a cluster stillreturns an unimplemented error.
See also: #84783
Assists: #72576
Release note: none