fix(pgvector): make doc deletion query faster and use chunking#289
Draft
fix(pgvector): make doc deletion query faster and use chunking#289
Conversation
index the source_id column in the access_list table Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
a957988 to
02b8435
Compare
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
02b8435 to
f03c10a
Compare
kyteinsky
commented
Mar 20, 2026
| f'{DOCUMENTS_TABLE_NAME}.source_id', | ||
| ondelete='CASCADE', | ||
| ), | ||
| index=True, |
Contributor
Author
There was a problem hiding this comment.
DB migration needs to be done for this to happen on existing installations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI logging for slow queries has also been enabled, not sure if we will see that in the CI though.
Sample output for the slow deletion query where a missing index on the
source_idforeign key in access_list table was the culprit.Calculated time: 3.495 + 0.310 + 0.129 = 3.934 ms
Actual time: 201177.123 ms or 201 s
(put the chunking part in a different PR)