renterd icon indicating copy to clipboard operation
renterd copied to clipboard

Migrate RenameObject to raw SQL

Open ChrisSchinnerl opened this issue 9 months ago • 0 comments

This is the first method migrated to the new raw sql database type. Starting with a smaller one to keep things easy.

NOTE: DeleteObject is different for SQLite and MySQL on purpose. SQLite is less granular when it comes to locking so in my experience performing the writing operation sooner rather than later in the txn reduces the frequency of locking errors.

MySQL on the other hand seemed to benefit from reading the value first to avoid the optimistic locking MySQL performs in the common case.

I'm sure now that we keep these implementations separate we will find many more spots where reorganising queries within transactions will help us improve performance for individual database engines.

ChrisSchinnerl avatar May 16 '24 09:05 ChrisSchinnerl