Skip to content

Add parent index on filecache - #36701

Merged
juliusknorr merged 1 commit into
masterfrom
artonge/feat/fc_parent_index
Mar 21, 2023
Merged

Add parent index on filecache#36701
juliusknorr merged 1 commit into
masterfrom
artonge/feat/fc_parent_index

Conversation

@artonge

@artongeartonge commented Feb 14, 2023

Copy link
Copy Markdown
Collaborator

To speed up:

$query->select('size', 'unencrypted_size')
->from('filecache')
->whereParent($id);

The current query uses the parent_name_hash index, which is not optimal with long names.

idselect_typetabletypepossible_keyskeykey_lenrefrows
Without index1SIMPLEoc_filecachereffs_parent_name_hashfs_parent_name_hash8const5
With index1SIMPLEoc_filecachereffs_parent_name_hash,oc_filecache_parentoc_filecache_parent8const5

@artongeartonge self-assigned this Feb 14, 2023
@artongeartonge added 3. to review Waiting for reviews php Pull requests that update Php code labels Feb 14, 2023
@artongeartonge added this to the Nextcloud 26 milestone Feb 14, 2023
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable25

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable24

icewind1991
icewind1991 previously requested changes Feb 15, 2023

@icewind1991icewind1991 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.

Also needs to be added to the migration that creates the filecache table

@artonge
artongeforce-pushed the artonge/feat/fc_parent_index branch from 32bbce6 to 407ff41CompareFebruary 15, 2023 14:58
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

Waiting for more practical feedbacks before moving on.

@szaimen
szaimen requested review from a team, ArtificialOwl, blizzz and juliusknorr and removed request for a teamFebruary 22, 2023 14:39
@juliusknorr

Copy link
Copy Markdown
Member

Can you outline or do you have a reference why the single index would be faster? At least from the explain there seems to be no difference.

@skjnldsvskjnldsv mentioned this pull request Feb 23, 2023
@icewind1991

Copy link
Copy Markdown
Member

Can you outline or do you have a reference why the single index would be faster? At least from the explain there seems to be no difference.

It seems that the size of the parent_name_hash index is causing performance issues

@blizzzblizzz mentioned this pull request Mar 7, 2023
@blizzzblizzz modified the milestones: Nextcloud 26, Nextcloud 27Mar 7, 2023
@szaimen

Copy link
Copy Markdown
Contributor

/rebase

@szaimen
szaimen enabled auto-merge March 20, 2023 14:44
@szaimenszaimen removed the 3. to review Waiting for reviews label Mar 20, 2023
@szaimenszaimen added the 4. to release Ready to be released and/or waiting for tests to finish label Mar 20, 2023
Signed-off-by: Louis Chemineau <louis@chmn.me>
@nextcloud-command
nextcloud-commandforce-pushed the artonge/feat/fc_parent_index branch from 407ff41 to bda66f9CompareMarch 20, 2023 15:03
@juliusknorr
juliusknorr disabled auto-merge March 21, 2023 07:32
@juliusknorr

Copy link
Copy Markdown
Member

Failure unrelated

@juliusknorr
juliusknorr merged commit 0d75a30 into masterMar 21, 2023
@juliusknorr
juliusknorr deleted the artonge/feat/fc_parent_index branch March 21, 2023 07:32
@szaimen

Copy link
Copy Markdown
Contributor

/backport to stable26

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 finishphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@artonge@juliusknorr@icewind1991@szaimen@blizzz