Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented May 1, 2020

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 [email protected]

@rullzer rullzer added enhancement 2. developing Work in progress labels May 1, 2020
@rullzer rullzer added this to the Nextcloud 20 milestone May 1, 2020
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 <[email protected]>
@rullzer rullzer force-pushed the enh/limit_group_queries branch from cf5eb75 to 5ebb535 Compare May 2, 2020 08:13
@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 7, 2020
@MorrisJobke
Copy link
Member

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

@rullzer
Copy link
Member Author

rullzer commented May 8, 2020

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.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

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
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
Member Author

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
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
Member Author

rullzer commented May 21, 2020

One more review please :)

@rullzer rullzer requested a review from juliusknorr May 22, 2020 11:12
@juliusknorr
Copy link
Member

php-cs check failure seems unrelated to that change 😉

@juliusknorr juliusknorr 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 master May 22, 2020
@rullzer rullzer deleted the enh/limit_group_queries branch May 22, 2020 12:19
@rullzer
Copy link
Member Author

rullzer commented May 22, 2020

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

@rullzer
Copy link
Member Author

rullzer commented May 22, 2020

/backport to stable19

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

Labels

4. to release Ready to be released and/or waiting for tests to finish enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants