-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: parse partial indexes #49335
sql: parse partial indexes #49335
Conversation
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.
Reviewed 15 of 15 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)
27fa106
to
49b2930
Compare
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner)
pkg/sql/create_index.go, line 203 at r2 (raw file):
// TODO(mgartner): remove this once partial indexes are fully supported. if n.Predicate != nil && !params.SessionData().PartialIndexes { return nil, pgerror.New(pgcode.FeatureNotSupported, "partial indexes are not supported")
The old error mentioned issue 9683, we should still do that, you can use unimplemented.NewWithIssue
pkg/sql/vars.go, line 608 at r2 (raw file):
// CockroachDB extension. // TODO(mgartner): remove this once partial indexes are fully supported. `partial_indexes`: {
make it experimental_partial_indexes
for now
49b2930
to
ea6c7fe
Compare
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @rytaft)
pkg/sql/create_index.go, line 203 at r2 (raw file):
Previously, RaduBerinde wrote…
The old error mentioned issue 9683, we should still do that, you can use
unimplemented.NewWithIssue
Done.
pkg/sql/vars.go, line 608 at r2 (raw file):
Previously, RaduBerinde wrote…
make it
experimental_partial_indexes
for now
Done.
This commit adds support for parsing partial indexes. The parser can now parse statements like: CREATE TABLE t (a INT, INDEX (a) WHERE a > 3) CREATE TABLE t (a INT, UNIQUE INDEX (a) WHERE a > 3) CREATE INDEX i ON t (a) WHERE a > 3 Note that these `WHERE` clauses have no effect as of this commit. Until further work is done, the `WHERE` clauses are ignored and full indexes are created. This commit also adds the ability to format the `Predicate` expression of `tree.CreateIndex` and `tree.IndexTableDef` expressions. A temporary session setting has been added called `partial_indexes`. When set to true, it enables the user to create partial indexes. By default, it is false because partial indexes are not fully supported. Once partial indexes are fully functional, this setting will be removed. Release note: None
ea6c7fe
to
b774f2e
Compare
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @rytaft)
bors r+ |
Build succeeded |
This commit adds support for parsing partial indexes. The parser can now
parse statements like:
Note that these
WHERE
clauses have no effect as of this commit. Untilfurther work is done, the
WHERE
clauses are ignored and full indexesare created.
This commit also adds the ability to format the
Predicate
expressionof
tree.CreateIndex
andtree.IndexTableDef
expressions.A temporary session setting has been added called
partial_indexes
.When set to true, it enables the user to create partial indexes. By
default, it is false because partial indexes are not fully supported.
Once partial indexes are fully functional, this setting will be removed.
Release note: None