Project

General

Profile

"Missing indexes in Nextcloud database" » History » Version 2

Gareth Eaton, 05/19/2024 01:47 PM

1 2 Gareth Eaton
h3. Missing indexes
2 1 Gareth Eaton
3 2 Gareth Eaton
If Nextcloud has identified missing database indexes, which can improve query performance, you can up them, however due to the potential time required to add indexes to large tables, this process was not done automatically.
4 1 Gareth Eaton
5 2 Gareth Eaton
To manually add the missing indexes while the instance remains operational, run the following command:
6 1 Gareth Eaton
<pre>
7
sudo -u www-data php occ db:add-missing-indices
8
</pre>
9
10 2 Gareth Eaton
For a non-interactive process, use:
11 1 Gareth Eaton
12
<pre>
13
sudo -u www-data php occ db:add-missing-indices --no-interaction
14
</pre>
15
16 2 Gareth Eaton
An example of a missing index is "mounts_class_index" in the "oc_mounts" table. Once the indexes are added, queries to these tables should execute faster.