perf(sharing): Avoid loading all shares from all users when unsharing#58057
perf(sharing): Avoid loading all shares from all users when unsharing#58057CarlSchwan wants to merge 1 commit intomasterfrom
Conversation
| // Figure out which users has some shares with which providers | ||
| $qb = $this->connection->getQueryBuilder(); | ||
| $qb->select('uid_initiator', 'share_type') | ||
| ->from('share') |
There was a problem hiding this comment.
But not all providers save their data in this table, no?
There was a problem hiding this comment.
At least talk, deck, circles and all the one in server do. I don't think there are more of them as the list is hardcoded in server
There was a problem hiding this comment.
I was thinking of federated shares, because it uses two tables, one for incoming and one for outgoing. I'm not entirely sure if this would be covered here.
There was a problem hiding this comment.
federated shares getSharesBy is also just checking the share table only. Ultimately, I think we should make the manager fetch the share data and then let the providers create the IShare with the createShare method.
This would make sharing quite a bit lighter
There was a problem hiding this comment.
Yes, but all share providers are slightly different and it's hard to unify all the logic.
834817d to
d600563
Compare
First check which users have a shares and for which providers and then only load these shares. Avoid doing at most 5 SQL queries for each users a share was shared with if there are no shares. Signed-off-by: Carl Schwan <carlschwan@kde.org>
d600563 to
a6b0c0a
Compare
Summary
First check which users have a shares and for which providers and then only load these shares.
Avoid doing at most 5 SQL queries for each users a share was shared with if there are no shares.
Checklist
3. to review, feature component)stable32)