core icon indicating copy to clipboard operation
core copied to clipboard

Missing indexes to speed up large installations

Open butonic opened this issue 12 years ago • 15 comments

Moving this here so we don't forget them:

   create index oc_group_user_uid on oc_group_user(uid);
   create index oc_share_file_target on oc_share(file_target);

EDIT: Those are no longer needed:

   create index oc_filepath on oc_filecache(storage,size);
   create index oc_files_versions_user on oc_files_versions(user);
   create index oc_files_trashsize_user on oc_files_trashsize(user);

Would be awesome if someone chould verify that they are actually helpful.

butonic avatar Feb 28 '14 12:02 butonic

@butonic I have a user who entered the above for Postgresql and is monitoring.

Note, the last 2 they get the following error:

owncloud=# create index files_versions_user on files_versions(user); ERROR: functions in index expression must be marked IMMUTABLE owncloud=# create index files_trashsize_user on files_trashsize(user); ERROR: functions in index expression must be marked IMMUTABLE

ser72 avatar Mar 25 '14 17:03 ser72

That's because postgres thinks that user is a function Quote the column name accordingly.

tessus avatar Apr 16 '14 21:04 tessus

@butonic State of this?

MorrisJobke avatar Jun 09 '14 07:06 MorrisJobke

@ser72 Can be resolved shorter term with a custom index.

MTRichards avatar Jun 20 '14 20:06 MTRichards

@butonic @MTRichards @ser72 @MorrisJobke I think I have explained the reason for the error. user has to be quoted, since it is a reserved word in postgres.

tessus avatar Jul 06 '14 05:07 tessus

@DeepDiver1975 @MTRichards can you enlighten me why this has been closed? obviously these indexes are not yet in core. So who takes care of testing these?

butonic avatar Jun 15 '15 14:06 butonic

you seriously ask why I closed something one year back? :speak_no_evil:

from my pov this issue in it self was not helpful - it contains no longer existing tables are contained wrong syntax. In addition: these optional indexes are documented - done.

DeepDiver1975 avatar Jun 15 '15 14:06 DeepDiver1975

In addition: these optional indexes are documented - done.

LOL the documentation is referencing this issue - this is so wrong.

DeepDiver1975 avatar Jun 15 '15 14:06 DeepDiver1975

Well I asked multiple times for an update on this issue and didn't get an answer, so if you think that's funny enjoy a good laugh.

carlaschroder avatar Jun 15 '15 14:06 carlaschroder

well, if indexes are missing it is a bug. nothing else. users should not be forced to find missing indexas in the documentation ...

butonic avatar Jun 15 '15 17:06 butonic

well, if indexes are missing it is a bug. nothing else. users should not be forced to find missing indexas in the documentation ...

thanks for repeating my sentences :speak_no_evil: PR are welcome

DeepDiver1975 avatar Jun 15 '15 17:06 DeepDiver1975

create index oc_filepath on oc_filecache(storage,size);

https://github.com/owncloud/core/commit/a339855b4c85812e0c7e35ff3f83a8534fc24289

MorrisJobke avatar Jul 08 '15 15:07 MorrisJobke

create index oc_files_trashsize_user on oc_files_trashsize(user);

6fcd135d0e871a918b2842647385b527cb823bb2

MorrisJobke avatar Jul 08 '15 15:07 MorrisJobke

create index oc_files_versions_user on oc_files_versions(user);

7ad0fee0b56d9ab678cbb52128d427ebd641b05e

MorrisJobke avatar Jul 08 '15 15:07 MorrisJobke

I added the remaining indexes in #17498

MorrisJobke avatar Jul 08 '15 16:07 MorrisJobke