Skip to content

Improve group queries - #20776

Merged
rullzer merged 1 commit into
masterfrom
enh/limit_group_queries
May 22, 2020
Merged

Improve group queries#20776
rullzer merged 1 commit into
masterfrom
enh/limit_group_queries

Conversation

@rullzer

Copy link
Copy Markdown
Member

Before we'd also get the diplayname for each group in the backend. In a
separate query. This is of course not ideal as this information is
obtained on each and every query. Now this is queried once and properly
cached.

Also added more caching to the manager.

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

@rullzerrullzer added this to the Nextcloud 20 milestone May 1, 2020
Comment threadlib/private/Group/Manager.php Outdated
Before we'd also get the diplayname for each group in the backend. In a
separate query. This is of course not ideal as this information is
obtained on each and every query. Now this is queried once and properly
cached.
Also added more caching to the manager.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
rullzerforce-pushed the enh/limit_group_queries branch from cf5eb75 to 5ebb535CompareMay 2, 2020 08:13
@rullzerrullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 7, 2020
@MorrisJobke

Copy link
Copy Markdown
Member

I guess this one here solves already part of the issue: #20815

@rullzer

Copy link
Copy Markdown
MemberAuthor

I guess this one here solves already part of the issue: #20815

Basically both are improvements. #20815 is making sure we only get what we need.
This one is making sure we get what we need in 1 go if we need it.

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

$this->groupCache[$row['gid']] = $row['gid'];
$this->groupCache[$row['gid']] = [
'gid' => $row['gid'],
'displayname' => $row['displayname'],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it this always displayname? I had this issue in Mail recently and I went for selectAlias to ensure the database does not return the selected column, like g.displayname

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but there is only 1 displayname... so it should not prefix it right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so.

@rullzer

Copy link
Copy Markdown
MemberAuthor

One more review please :)

@rullzer
rullzer requested a review from juliusknorrMay 22, 2020 11:12
@juliusknorr

Copy link
Copy Markdown
Member

php-cs check failure seems unrelated to that change 😉

@juliusknorrjuliusknorr added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 22, 2020
@rullzer
rullzer merged commit fd805a0 into masterMay 22, 2020
@rullzer
rullzer deleted the enh/limit_group_queries branch May 22, 2020 12:19
@rullzer

Copy link
Copy Markdown
MemberAuthor

I guess a backport makes sense here. At least to stable19 for 19.0.1

@rullzer

Copy link
Copy Markdown
MemberAuthor

/backport to stable19

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rullzer@MorrisJobke@juliusknorr@ChristophWurst@kesselb