Repository navigation
Add getTagsForObjects in ITags - #12409
Conversation
|
I'm not sure whether this API call should pre-group the tags by object id as it might have some performance impact. |
|
Set milestone to OC 8 as it's a requirement to be able to implement files favorites. |
|
🚀 Test PASSed. 🚀 |
There was a problem hiding this comment.
Is this even worth the trouble? the query will not be faster, but the code is way more complex with this exception.
There was a problem hiding this comment.
If called multiple times in a row, having a prepared statement will make subsequent calls faster. (the prepared statements are cached somewhere inside our DB wrappers)
But as you say, not sure if it's worth the hassle.
There was a problem hiding this comment.
@icewind1991 can you give a second opinion on this ?
There was a problem hiding this comment.
not worth it, executequery() internally creates a prepared statement because that implements the logic to replace questionmarks with the correctly escaped value.
if you really want to make this faster you should reduce the number of trips to the db. have a look at the search query in the filecache that does chunks of 1000 with sql IN () to not break mysql.
There was a problem hiding this comment.
Ok thanks for the clarification, I'll make this a single block.
|
I just changed the output response, now it look like this: 7f65341#diff-dfb81a403f62a6e3eb4355d23574c370R83 |
|
💣 Test FAILed. 💣 Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git2310964744155017692.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12409/merge^{commit} # timeout=10Checking out Revision 340b8a71a884d7062eb0363688007bf2297f6651 (detached) > git config core.sparsecheckout # timeout=10 > git checkout -f 340b8a71a884d7062eb0363688007bf2297f6651 > git rev-list e72fb50fbd935e0411f05e344ca50693d3945918 # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » vm-slave-02pull-request-analyser-ng-simple » vm-slave-02 completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 20 second💣 Test FAILed. 💣 |
|
|
💣 Test FAILed. 💣 Build result: FAILURE[...truncated 15 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git622049702073431526.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12409/merge^{commit} # timeout=10Checking out Revision 1c52a033124a822434a9cc52dc9291bcc24afd44 (detached) > git config core.sparsecheckout # timeout=10 > git checkout -f 1c52a033124a822434a9cc52dc9291bcc24afd44 > git rev-list 7aabfa3e7fffd1486c0c1a27e935605b57d98062 # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » vm-slave-02Configuration pull-request-analyser-ng-simple » vm-slave-02 is still in the queue: Waiting for next available executor on vm-slave-02pull-request-analyser-ng-simple » vm-slave-02 completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 12 second💣 Test FAILed. 💣 |
|
🚀 Test PASSed. 🚀 |
|
I fixed the query |
|
Code looks good 👍 |
There was a problem hiding this comment.
Invalid PHP Doc. @return array $entries
d93d470 to
8c7188a
Compare
|
Fixed and squashed |
|
💣 Test FAILed. 💣 Build result: FAILURE[...truncated 18 lines...]using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git4318160896435315280.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12409/merge^{commit} # timeout=10 > git branch -a --contains 1eaf2ffd5d1c33fde46f50fa462d5327c2d092d9 # timeout=10 > git rev-parse remotes/origin/pr/12409/merge^{commit} # timeout=10Checking out Revision 1eaf2ffd5d1c33fde46f50fa462d5327c2d092d9 (origin/pr/12409/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 1eaf2ffd5d1c33fde46f50fa462d5327c2d092d9First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » vm-slave-02Configuration pull-request-analyser-ng-simple » vm-slave-02 is still in the queue: Waiting for next available executor on vm-slave-02pull-request-analyser-ng-simple » vm-slave-02 completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 5 minutesDisk usage plugin fails during calculation disk usage of this build.💣 Test FAILed. 💣 |
There was a problem hiding this comment.
Do we need keep the mysql limit for the number of values in an IN into account or does dbal handle it?
|
👍 otherwise |
|
🚀 Test PASSed. 🚀 |
There was a problem hiding this comment.
hm ... The limit I ran into is 1000: 592a2dc#diff-fe310df5db90426b42447108ef4d3483L331
The code has since been removed by recursively descending the tree ...
There was a problem hiding this comment.
Yeah... I found other pieces of code, some with 200, 90 or 20... I picked the biggest number.
Should I increase to 1000 then ?
Returns the list of tags that are set on the given object ids.
b9fa1b4 to
cae6007
Compare
|
Changed chunking limit to 1000 |
|
The inspection completed: 9 new issues, 3 updated code elements |
|
🚀 Test PASSed. 🚀 |
|
@nickvergessen @butonic @LukasReschke can this be merged ? |
There was a problem hiding this comment.
I think we should add a method for that to our DB object instead of having this duplicated in the code again and again...
But okay for now
There was a problem hiding this comment.
Will be done here: #12219
I'll add a comment to make sure the chunking part is added there as well.
|
@nickvergessen Do your comments containing the keyword "okay" count as a thumbs up ? |
|
👍 |
Add getTagsForObjects in ITags
Returns the list of tags that are set on the given object ids.
Required for the "favorites/tags" task (#2368) but also a nice addition to the API.
See https://github.com/owncloud/core/pull/12360/files#diff-471be045dd1eb605d9a1197b9ba90560R52
Please review @ockham @LukasReschke @icewind1991 @DeepDiver1975