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

idxtype: add idxtype package #139786

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andy-kimball
Copy link
Contributor

@andy-kimball andy-kimball commented Jan 24, 2025

Add new sql/sem/idxtype package that defines an index type enum with values
like forward, inverted, and vector, as well as "capability" functions describing
what the index can or cannot do. Code across SQL needs to check the index
type and previously it used multiple different enums and bools. This commit
continues the process of unifying these mechanisms (future commits will do
even more).

Epic: CRDB-42943

Release note: None

Add new sql/sem/idxtype package that defines an index type enum with values
like forward, inverted, and vector. Code across SQL needs to check the index
type and previously it used multiple different enums and bools. This commit
continues the process of unifying these mechanisms (future commits will do
even more).

Epic: CRDB-42943

Release note: None
Now that we have the new idxtype.T enumeration that specifies the type
of index (e.g. forward, inverted, vector), use that in the opt packages
rather than IsInverted and IsVector boolean functions. This will make
our code more extensible, such that adding new index types is easier,
starting with vector indexes.

Epic: CRDB-42943

Release note: None
@andy-kimball andy-kimball requested review from a team as code owners January 24, 2025 22:10
@andy-kimball andy-kimball requested review from jeffswenson and removed request for a team January 24, 2025 22:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andy-kimball
Copy link
Contributor Author

andy-kimball commented Jan 24, 2025

Note that there are 3 commits in this PR: the 1st commit contains mostly Foundations changes and the 2nd commit mostly Queries changes. The 3rd commit adds Supports and Allows methods in the idxtype package, so that we consolidate the code that checks index capabilities.

@andy-kimball andy-kimball removed the request for review from jeffswenson January 25, 2025 00:35
Add helper functions that specify the capabilities of various index
types. For example, only FORWARD indexes can be primary or unique,
and only INVERTED and VECTOR indexes support prefix columns.

Use these new helper functions across the SQL packages.

Epic: CRDB-42943

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants