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

Create hash index on delete_tasks.index_uid #4780

Closed
wants to merge 1 commit into from

Conversation

guilload
Copy link
Member

Description

That query is very slow on Airmail but not at all on Cicada.

@trinity-1686a, what are your thoughts? Should we make (index_uid, opstamp`) the primary key of this table instead? The b-tree could help select both the index UID and max opstamp.

How was this PR tested?

Ran migrations.

@guilload guilload requested a review from trinity-1686a March 21, 2024 22:56
@trinity-1686a
Copy link
Contributor

i'm supprised there is a bottleneck there on Airmail. I didn't think delete was used on that cluster.
A primary key/btree index on (index_uid, opstamp) would help with every queries we do.
It looks like we never delete old delete_tasks, so an index covering opstamp will become necessary at a time or another in the life of a cluster. But I think that means we should GC tasks which aren't useful anymore ("all splits up to date, and task older than x minutes", to make sure no new split with an old opstamp is created). With that, a hash on index_uid would probably be enough, as there wouldn't be that many delete tasks in store at any given time, and that number wouldn't grow with time either.

@guilload guilload closed this Mar 28, 2024
@guilload guilload deleted the guilload/pg-delete-tasks-index branch March 28, 2024 20:35
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