-
Notifications
You must be signed in to change notification settings - Fork 372
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
Support Create Index #1199
Support Create Index #1199
Conversation
cc9ed01
to
988116e
Compare
7b26363
to
a95f318
Compare
TableRowId((u64, Option<&'a ImmutableRecord>)), | ||
IndexKey(&'a ImmutableRecord), |
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.
TableRowId
's record is not really a "key" but the record to insert right? Does it make sense to remain separate to the key?
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.
Yeah this was kind of a pain.. why I included that is because otherwise the arguments to insert
would be:
pub fn insert(
&mut self,
key: &BTreeKey,
record: Option<&ImmutableRecord>,
moved_before: bool,
) -> Result<CursorResult<()>> {
So making it part of the key felt like ergonomically the best choice.
But indeed, prob at least could use a better name 🤔
Closes #1193
This will create the initial index btree and insert whatever relevant records that need to be inserted, it doesn't handle the case of inserting new index keys when normal records are created afterwards. That will prob be added in next PR to keep this one concise.
Limbo will properly use the index in a subsequent query:

Creating a unique index on a column that has 2 existing identical rows:
