Skip to content

Reduce duplicate queries when fetching user boards an permissions - #3161

Merged
juliusknorr merged 1 commit into
masterfrom
bugfix/sql-queries
Jul 5, 2021
Merged

Reduce duplicate queries when fetching user boards an permissions#3161
juliusknorr merged 1 commit into
masterfrom
bugfix/sql-queries

Conversation

@juliusknorr

@juliusknorrjuliusknorr commented Jul 2, 2021

Copy link
Copy Markdown
Member

First step to reduce the amounts of queries that happened during collecting incoming shares when setting up the filesystem for users.

Already gives quite some improvement in test setup with 1 shared board having 3 cards with a handful of attachments on each:
https://blackfire.io/profiles/compare/67ec272e-9530-491b-afb2-0fb2c9b06f59/graph

image

Comment threadlib/Db/BoardMapper.php Outdated
Comment threadlib/Db/BoardMapper.php Outdated

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.

isset() is said to be faster, but there is a small difference –https://www.php.net/manual/en/function.array-key-exists.php example #2. For consideration.

Comment threadlib/Db/BoardMapper.php Outdated

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.

could be also CappedMemoryCache to avoid overflow.

Comment threadlib/Service/PermissionService.php Outdated

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.

also isset for consideration

Comment threadlib/Db/BoardMapper.php Outdated
Comment threadlib/Db/BoardMapper.php Outdated
@juliusknorr
juliusknorr requested a review from blizzzJuly 5, 2021 07:57
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable22

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

/backport to stable1.4

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

Looking into the tests

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@juliusknorr@nickvergessen@blizzz