Database indexes missing

After update to 23.0.4 the safety manager reports some missing indexes:

  • Fehlender Index “fs_id_storage_size” in der Tabelle “oc_filecache”.
  • Fehlender Index “fs_storage_path_prefix” in der Tabelle “oc_filecache”.
  • Fehlender Index “properties_pathonly_index” in der Tabelle “oc_properties”.
  • Fehlender Index “job_lastcheck_reserved” in der Tabelle “oc_jobs”.

Can I find somewhere a SQL script what generates these indexes?

Hi @fanThomas,
You are missing the required support template. Please fill this form out and edit into your post.

This will give us the technical info and logs needed to help you! Thanks.

Thanks, but this is too much to collect. I’ll fix the problem myself.

I’d suggest someone write a script what would collect all this data so we could simply cut and paste it. This would also be easier to read for you because it has always the same format.

Seriously? You can’t even tell us what OS you’re using?

Ok, I’ll assume you’re using FreeBSD like me. I have a text file with a bunch of commands that fix these issues:

cd /usr/local/www/nextcloud
su -m www -c "php ./occ upgrade"
su -m www -c "php ./occ db:add-missing-indices"
su -m www -c "php ./occ db:add-missing-columns"
su -m www -c "php ./occ db:add-missing-primary-keys"
su -m www -c "php ./occ db:convert-filecache-bigint"
su -m www -c "php ./occ maintenance:mode --off"

Looks like you need the “add-missing-indicies” command.

If you want something that is more appropriate to your system, log into Nextcloud as an admin, go to “Settings”, then “Overview” (under “Administration” on the left hand menu).

It will tell you what command you should use on your system to fix the indicies.

And next time, be a little more helpful with your post. We can’t work miracles or read minds.