How to deal with database checks?

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 35.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • none
  • PHP version (e.g, 8.3):
    • 8.5
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • When Nextcloud introduced database checks in the UI
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

The “database checks” show a number of “findings”:

  • Joins without indexes - failing
  • High sorted-row rate - notice
  • Join-without-index rate - notice
  • Full-index-scan rate - notice
  • Fixed-position read rate - notice
  • Sequential-row read rate - notice

But I am just a user (yes, I administer this machine, but still I did not create Nextcloud on my own but just use it) and did not create the database statements on my own. However the instance also has a number of apps installed and is used by more than 50 users. I also don’t notice any problems when using Nextcloud - everything works as fast as expected. So what exactly should I do here? Is Nextcloud “out of the box” without these findings and some apps may cause this?

have you searched the forum for similar problems?

etc (i was searching for “db” and “NC35” - of course there are more than those. maybe you’ll find some more useful hints there

Yes, I did search for it. But the point is, that it does not help to tell about database issues, when the database queries are created by the Nextcloud developers and not the users.

For example:

Joins without indexes - yes, I know what this means, since I also develop software and use databases.

However, in the general check of the instance there are no missing indexes and I did not create any of the database statements in Nextcloud. So even if I identify the specific SQL statements which causes a join without index - this is just the end result of some backend code in Nextcloud.

That’s why I ask what I should do here - do the developers want to see the affected statements, so they can fix it for the future?

Perhaps my experience might be of some help.

My system basics:

  1. Nextcloud Server version (e.g., 29.x.x):
    • 35.0.2
  2. Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  3. Web server and version (e.g, Apache 2.4.25):
    • nginx/1.24.0
  4. Reverse proxy and version _(e.g. nginx 1.27.2)
    • none
  5. PHP version (e.g, 8.3):
    • 8.4.27
  6. Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  7. When did this problem seem to first start?
    • When updating Nextcloud to latest version
  8. Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Bare metal
  9. Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

I get the following ‘falling’ warnings (and other ‘hints’ which I won’t mention as they’re irrelevant), namely:

Performance 1 failing

Joins without indexes

Warning ·Select_full_join

Failing

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

0.9211% of queries did a full join without an index.

Identify the offending queries (set log_queries_not_using_indexes) and add the missing indexes.

Value 0.92

Memory 1 failing

On-disk temp tables

Warning ·Created_tmp_disk_tables

Failing

A large share of temporary tables are being created on disk instead of in memory.

45.9599% of temp tables ended up on disk.

Increase tmp_table_size and max_heap_table_size to keep more temp tables in memory.

Value 45.96

Adjustment tmp_table_size→64M

Show config snippet

These are false alerts as they do not indicate any database malfunctions. Nextcloud misinterprets performance issues because it uses fixed settings that are not tailored to my database’s usage. The Nextcloud developers should allow users to customise the alert settings.

Check solution for “Joins without indexes - failing” (the only failing one I had that didn’t have a config snippet fix) here: Database check findings

Following up on my previous message, the reasons I am making this request are as follows:

The current database integrity checks (under “Administration settings” → “Overview”) use hardcoded thresholds (e.g., triggering a “Failing” status when Select_full_join > 1% or Created_tmp_disk_tables is high).

For small to medium instances with moderate traffic, these hardcoded percentages are statistically skewed. A very small number of “imperfect” but harmless queries (like information_schema lookups) triggers false-positive “Failing” warnings. This creates “warning fatigue” for system administrators, as these warnings do not correlate with actual performance bottlenecks or slow queries.

I propose adding configuration options in config.php to customize these thresholds. For example:

‘database.integrity.check.full_join_threshold’ => 5.0, // Allow up to 5%
‘database.integrity.check.tmp_disk_threshold’ => 20.0, // Allow up to 20%

Alternatively, allow us to disable specific database performance warnings in config.php if the administrator has verified the database performance via logs (e.g., using percona-toolkit).

Currently, the only way to clear these warnings is to restart the database service to reset the GLOBAL STATUS counters. This is a workaround, not a solution, and doesn’t represent the true health of the database

Additional information:

  1. I have verified my database performance using slow query logs and EXPLAIN analysis.
  2. My queries are optimized, but the nature of Nextcloud’s schema (many small tables, JSON columns) makes it statistically impossible to keep these counters below the current hardcoded thresholds in a small-volume production environment.