Repository navigation
Reduce database work when creating lists and saving domains - #8379
Draft
labkey-jeckels wants to merge 5 commits into
Draft
labkey-jeckels wants to merge 5 commits into
labkey-jeckels wants to merge 5 commits into
Conversation
Domain saves now invalidate only the caches they affect, list creation skips a duplicate index pass, and post-commit tasks share one pooled connection. Also stops domain saves from dropping stored default values.
Hold the thread connection only for cache replay and domain audit writes, so other post-commit tasks can open transactions without holding a second connection. Domain saves can clear stored defaults again and skip default writes that change nothing; the specimen domain creation cache holds domain ids instead of Domains.
Contributor
Author
|
Updated local benchmark after 494b962, which narrows the post-commit connection hold to cache replay and domain audit writes and skips no-op default-value writes. Each run is 50 picklist creates through
Borrows are about 3 per create higher than with the earlier hold across every post-commit task. That is the cost of not holding a pooled connection while post-commit tasks may open their own transactions. |
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.
Rationale
Creating a list or picklist through
property-createDomain.apicosts far more database work than it should. A customer load test of picklist creation showed that each create reloaded unrelated caches and took dozens of pooled connections. This PR cuts that work: in local testing, 50 picklist creates went from 164 to 109 statements per create, from 37 to 24 pooled connection borrows per create, and from 0.254 s to 0.205 s median latency.Changes
DomainorDomainPropertyare flagged unless their cache is evicted when the domain is saved; the specimen domain creation cache now holds domain ids insteadTasks