Improve move performance by doing only one query if possible#38649
Improve move performance by doing only one query if possible#38649jvillafanez merged 6 commits intomasterfrom
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
open interface method in the IDBConnection
|
There is a connectivity issue between ownCloud and oracle 18c XE, but the query itself works. |
|
@jvillafanez should be for review or still draft? |
|
The connectivity issue with oracle 18 XE can be fixed separately (if it isn't a problem on my side), so yes, this is ready to review. |
| } | ||
|
|
||
| // for other DBs (sqlite), we keep the old behaviour -> get the list and update one by one | ||
| $sql = 'SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path` LIKE ?'; |
There was a problem hiding this comment.
isnt it cleaner to put in switch case default ? and for other just have duplicate $this->connection->executeQuery ? It is pretty confusing to read.
There was a problem hiding this comment.
I can't say for sure. For sqlite, we have multiple queries to do, it isn't just one query. The implementation is quite different. I didn't want to touch the old implementation because it "works". Note that it isn't a "run queries A, B and C", but a "run query A, and then, based on the results, run query B multiple times"
In addition, one of the reasons to implement it this way is that we can easily comment out a possible faulty query (specially for oracle) so we can switch to the old behaviour.
Maybe splitting into 2 different method might help, but we lose the easy switching between old and new implementation.
|
Kudos, SonarCloud Quality Gate passed! |
|
Bugfix in #38783 |
Description
Make only one query for the move operation if possible. Except for sqlite, which will keep the previous behaviour, the rest of the DBs will use 1-2 queries.
Related Issue
No linked issue
Motivation and Context
This will improve performance for the affected DBs
How Has This Been Tested?
Tested manually with postgresql 9.2, oracle 11 XE, oracle 18 XE and MariaDB
Screenshots (if appropriate):
Types of changes
Checklist: