- Notifications
You must be signed in to change notification settings - Fork531
perf: Optimize metadata records processing inSqlStorageClient#1551
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
vdusek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please PR type without an exclamation mark
janbuchar commentedNov 18, 2025
Interesting! I'd imagine that transactions consisting of e.g., an insertion to the dataset_items table and an update to dataset metadata wouldn't lock the metadata table for that long - you can commit right after the update to metadata. Also, the buffering approach is faster because the buffer table gets a row for each increment and those get compacted later on, correct? |
Mantisus commentedNov 18, 2025
They will create many short-lived locks. And with a large number of clients with high concurrency inserting new records, this effect will accumulate. Although, of course, the strongest impact on RequestQueue Yes, insert operations into the buffer table are quite fast. And then we can simply apply the result of the aggregations to update the metadata record. |
SqlStorageClientjanbuchar commentedNov 19, 2025
I see, thanks. And is there any chance that the lock is held for too long because of how we work with sqlalchemy? In other words, would it be better if we just executed sql such as |
Mantisus commentedNov 19, 2025
I will test this approach. |
Uh oh!
There was an error while loading.Please reload this page.
Description
buffertables to improve handling ofmetadatarecords. The key change is that updates tometadataare now accumulated inbufferand applied whenget_metadatais called. With the old behavior,metadatarecords were updated instantly within a transaction. This led to waiting for locks to be released in high-concurrency situations.Issues