Database check errors since 35.0.0

Since upgrade to version 35.0.0 I get errors from the new db check tool, like:

Some joins are scanning entire tables because no usable index exists on the join column.

Many SELECTs are doing full table scans or joins without indexes.

and more. There are no suggestions for a repair step. occ db:add-missing-indices does not make a difference.

OS: Debian 13.7

Database: MariaDb 11.8.6

Webserver: Apache 2.4.68, PHP 8.4

@eehmke welcome back :waving_hand:

you’ve been around for a while, you know the ropes right?

you left out the support template, please edit your post and add the required information.

Upgraded last night. Exact same symptoms.

It looks like it suggests changes to the database config file. Mariadb in my case. I won’t be touching anything without more information.

Good call—better to verify first.

I have similar error after updated to Nextcloud 35 on Truenas:

Notice ·pg.tables_without_index_use

Failing

Some tables have many sequential scans and no index scans, suggesting a missing index.

1 table(s) have > 1M sequential scans without any index scans.

  • oc_appconfig

Add appropriate indexes to the affected tables (pg_stat_user_tables shows the full scan statistics).

I tried “occ db:add-missing-indices” but did not fixed the issue.

DB is PostgreSQL 18.6

The behaviour did not change with 35.0.1.

Can confirm this. My installation is on Debian 13 using MariaDB as database.

Upgraded from 34.0.4 to 35.0.1 and got the database errors.

Same issue here. Upgraded via Docker to 35.x and getting the below error. Any assistance would be appreciated. Running on UgreenOS (Debian) and MariaDB.

root@xxxxxxxxxxxx:/var/www/html# php ./occ upgrade
Setting log level to debug
Updating database schema
Updated database
OCP\DB\Schema\SchemaException: The table with name "nextcloud.oc_sharing_classmap" already exists.
Update failed
Maintenance mode is kept active
Resetting log level
The database schema does not match what is expected for the installed version:
  - missing table 'oc_federated_invites'
  - unexpected table 'oc_ocm_token_map'
Run "occ db:schema:check -v" for details.
root@xxxxxxxxxxxx:/var/www/html# ./occ db:schema:check -v
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
missing table 'oc_federated_invites'
unexpected table 'oc_ocm_token_map'

I started this thread to report about a specific problem. Please stop this discussion that covers a much broader spectrum. You can start an own thread.

I am so sorry. Didn’t know you own it before I hijacked it. However if you read this thread, you’d not only find the cause, but also a solution to your problem and a warning to not become too eager. You are welcome.

The original post is about missing indexes. One of the early mentioned problems is about the oc_appconfig table that is missing indexes. In my installation, this is also the only error - no unwanted tables.
That is AFAIK a core table, not created by an extra app. I don’t see a sollotion for this problem in this (long) thread.

Yeah, the thread got a little out of hand, and I certainly played my part in that. I don’t really feel bad about it, though, because… well, a) OP didn’t fill out the support template, and then everyone who had some random issue related to their database started posting here.

But apparently that wasn’t enough, so of course someone also had to use the opportunity to turn it into a general discussion and bring the term “enshittification” into it. Sorry, but at that point, the thread was pretty much doomed anyway. :wink:

Unlisted thread as it was way off-topic.
Will split it …