-
Notifications
You must be signed in to change notification settings - Fork 158
BDM bulk delete speed improvements #12022
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
Open
whatisgalen
wants to merge
24
commits into
dev/8.1.x
Choose a base branch
from
gvm/bulk_delete_improvements
base: dev/8.1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
… to tile.save, re #12015
…letion, update, re #12015
Member
Author
|
I didn't do a numerical comparison but reversing loads is significantly faster, somewhere between 10-50x faster |
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.
Types of changes
Description of Change
Deleting data should be the fastest CRUD operation, so why does it take as long as (or longer than) Load inserts? The short answer is:
A few highlights:
ResourceXResource.deletemethod, deletes a tile that has no related resources in tile.data arraytile.saveandtile.delete:recalculate_descriptors=Truesince most of the time it's not needed, especially when bulk indexing usually handlesrecalculate_descriptorsin its own block of codeResourceproxy model now hasself.torelations = []andself.fromrelations = []properties for storing prefetched relationsResourceproxy modelsavemethod now callsself.save_descriptorsand passesrecalculate_descriptors=Falseto localtile.savesindex_database.optimize_resource_iterationnow prefetches a resource's related resourcesBulkDataDeletion.delete_resourcesusesoptimize_resource_iterationinstead of doing its own thingreverse_edit_log_entriesnow usesiterators, bulk indexes tile deletion, and doesn't index until necessaryload.reversewill reset the load status to the original status instead of being stuck in "unloading"Issues Solved
Addresses #12015
Checklist
Accessibility Checklist
Developer Guide
Ticket Background
Further comments