Skip to content

Comments

Index creation fixes#5913

Merged
lutter merged 4 commits intomasterfrom
lutter/idx-creation
Mar 26, 2025
Merged

Index creation fixes#5913
lutter merged 4 commits intomasterfrom
lutter/idx-creation

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Mar 26, 2025

This fixes two issues with postponed index creation:

(1) When the table has a user-supplied block column, we created the index on block$ twice
(2) We did not create postponed indexes on (<attr>, block$)

@lutter lutter requested a review from zorancv March 26, 2025 01:46
if !column_exists(cols, &"block".to_string()) {
return false;
}
return dest_table.immutable;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return dest_table.immutable;
if !dest_table.immutable {
return false;
}

Copy link
Contributor

@zorancv zorancv Mar 26, 2025

Choose a reason for hiding this comment

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

We need to check the rest of the columns in case the condition is true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doh .. yes, you are right.

Copy link
Contributor

@zorancv zorancv left a comment

Choose a reason for hiding this comment

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

Thank you for fixing those issue!

@lutter
Copy link
Collaborator Author

lutter commented Mar 26, 2025

Just addressed the comment (and also beefed the test up a little more)

lutter added 4 commits March 26, 2025 12:26
If an immutable entity type has a `block` column, we would emit the index
on the block$ twice, making deployment fail
At the end of copying, we do not want to create indexes concurrently, but
we do want the creation to be idempotent, i.e., have a 'if not exists'
clause
Test that the create index statements do/do not contain 'if not exists'
Do not short-circuit checking other columns in the check for Block
@lutter lutter force-pushed the lutter/idx-creation branch from 45b9122 to 0e2ee0a Compare March 26, 2025 19:26
@lutter lutter merged commit 0e2ee0a into master Mar 26, 2025
6 checks passed
@lutter lutter deleted the lutter/idx-creation branch March 26, 2025 22:52
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