Create api for syncing with database#273
Closed
jenny-codes wants to merge 1 commit intojennyshih/index-new-and-updatedfrom
Closed
Create api for syncing with database#273jenny-codes wants to merge 1 commit intojennyshih/index-new-and-updatedfrom
jenny-codes wants to merge 1 commit intojennyshih/index-new-and-updatedfrom
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0bae2cc to
78fd02b
Compare
7620ae3 to
2d7510b
Compare
78fd02b to
d98722f
Compare
d98722f to
ab5ad4b
Compare
2d7510b to
9f8eefa
Compare
ab5ad4b to
ccb51bd
Compare
9f8eefa to
fbfd830
Compare
ccb51bd to
5a0ef63
Compare
This was referenced Oct 30, 2025
5a0ef63 to
fead57d
Compare
1a0b597 to
0134e3c
Compare
fead57d to
9ec172e
Compare
0134e3c to
e1541ac
Compare
457473e to
a83a585
Compare
e1541ac to
5089b00
Compare
a83a585 to
cb8608a
Compare
00c882a to
4bcd1de
Compare
cb8608a to
5c010c2
Compare
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.

Add an api to remove the deleted + stale uris and their associated entities from the database, and insert the updated and new entries.
See #210 for more context.
For the deletion we use the
delete from ... where id in ... batch delete which is a bit more complicated than the single delete but it proves to be much faster than the single deletion queries. Calling this out because we have discovered that the batch mutation queries do not always improve performance in other cases.Benchmark
Benchmarking on Shopify core. Method: run the index once, and then index an empty collection of documents.
Before (no deletion, no re-indexing unchanged documents)
After (enabling deleting, without batch delete)
The first attempt was to delete the uris one by one, as is the pattern so far, but it proves to be extremely slow, taking 37 minutes to delete the whole shopify core index data. Even in the medium corpus with 1000 files, it takes 9 seconds for the deletion to complete.
After (enabling deleting, with batch delete)
The second attempt (the current implementation) is using bulk deletion, which is much faster. It now takes 9 seconds to delete all data from Shopify core.