Skip to content

[Bug]: Created_tmp_disk_tables warning despite temporary table limits being set to 64 MB #1224

Open

Description

@S1RIUS1

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

Description

Nextcloud displays an “On-disk temp tables” warning:

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

The check is marked as failed, initially reporting 45.46%, and recommends increasing tmp_table_size and max_heap_table_size.

However, both settings are already configured to 64 MB, and MariaDB confirms that these values are active.

Configuration verification

SELECT
    @@GLOBAL.tmp_table_size AS tmp_global,
    @@GLOBAL.max_heap_table_size AS heap_global,
    @@SESSION.tmp_table_size AS tmp_session,
    @@SESSION.max_heap_table_size AS heap_session;

Result:

tmp_global   : 67108864
heap_global  : 67108864
tmp_session  : 67108864
heap_session : 67108864

MariaDB counters

A subsequent status check returned:

Created_tmp_disk_tables : 1021
Created_tmp_tables      : 2369
Uptime                 : 163965 seconds

This represents approximately 43.10% of temporary tables being created on disk over 45 hours and 33 minutes of uptime.

Observed impact

Nextcloud works normally, with no noticeable slowdowns. The warning is the only observed issue.

Question / suggested improvement

Should this check consider the number of temporary tables created, the measurement period, and the effective configuration values before recommending an increase?

It would be helpful for the warning to explain that disk-based temporary tables may still occur with these settings, and that a high percentage alone does not necessarily indicate a performance problem.

Steps to reproduce

Go to index.php/settings/admin/overview

Expected behavior

No warning

Nextcloud Server version

35

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Activity

  1. added theissue type on Oct 23, 2026
  2. Lawkss commented on Oct 23, 2026

    @Lawkss

    Same problem.

    I even set this to 128M and it still shows the same error after 24/48hrs of being cleared. Looks like it is always triggered at 57-58M or something.

  3. matthiasdanner commented on Oct 24, 2026

    @matthiasdanner

    I have two observations on this to share:

    1. the check influences its own result. So when I'm refreshing the admin page, the value drops as more and more tables are created in memory. You can even get this check to succeed if you constantly refresh the admin page.
    2. I think there is a portion of tables that get created always on disk. When the server doesn't have much load there is always a certain number of tables on disk. The mariaDB documentation states that temp tables including TEXT or BLOB columns will alwas be stored on disk using the aria engine, which is default for temp tables. https://mariadb.com/docs/server/reference/data-types/string-data-types/varchar#difference-between-varchar-and-text

    So I think the check alone on the ratio is not enough, maybe there should be a threshold in absolute size of on disk tables when the check starts to trigger a warning.

  4. REggleston27 commented on Oct 24, 2026

    @REggleston27

    Same here on MariaDB 10.11.18 (Debian 12): tmp_table_size and max_heap_table_size both 64M (confirmed in config and SHOW GLOBAL VARIABLES), Created_tmp_disk_tables still ~49% of Created_tmp_tables. Nextcloud runs fine. Presumably temp tables with TEXT/BLOB columns, which go to disk regardless of size limits, so no setting can clear this check.

  5. nycoagung commented on Oct 25, 2026

    @nycoagung

    Same here, and I captured the queries, which confirms the TEXT/BLOB explanation above.

    Setup: Nextcloud 35.0.2, serverinfo 7.0.0, MariaDB 11.8.9. tmp_table_size and max_heap_table_size are both 64M, and the check shows 54% (934 of 1,844 temp tables on disk).

    With long_query_time = 0 and log_slow_filter limited to on-disk temp tables or full joins, plus log_slow_verbosity = 'query_plan,explain', the slow log records each matching query with its temp-table counts and sizes. Two sources turned up, neither related to size:

    1. Calendar reminder background job. The query joining oc_calendar_reminders with oc_calendarobjects/oc_calendars has a GROUP BY that includes co.calendardata (a BLOB):

      # Rows_examined: 4
      # Tmp_tables: 1  Tmp_disk_tables: 1  Tmp_table_sizes: 8192
      

      An 8 KB temp table went to disk with a 64 MB limit.

    2. The admin Overview page itself. The core setup checks for missing columns, indices and primary keys and for bigint conversions each run Doctrine schema introspection over information_schema. In every run, the information_schema.COLUMNS query creates 5 temp tables, 3 of them on disk, about 5 MB in total. That table has three longtext columns (COLUMN_DEFAULT, COLUMN_TYPE, GENERATION_EXPRESSION). One Overview load therefore adds 40 temp tables, 12 of them on disk (30%). That's the self-influence @matthiasdanner noticed: reloading Overview pulls the ratio towards about 30%.

    So for these temp tables, no value of tmp_table_size or max_heap_table_size changes anything, and the recommendation can't be acted on. Possible fixes: skip the rule, or make it a notice, once both settings are at or above the recommended value. Or use an absolute threshold, as suggested above. This also answers #1134: a larger recommended value wouldn't help these temp tables either.

  6. salmart-dev commented on Oct 27, 2026

    @salmart-dev

    Hello @S1RIUS1,

    thank you for reporting the issue. I think the check may be reporting too eagerly and lacks a check for the current value being equal or greater than the recommended one. Also, as already reported, BLOB and TEXT columns always hit the disk so the check needs adjustments.

  7. moved this from To triage to Confirmed in 🧑‍🤝‍🧑 Community triageon Oct 27, 2026
  8. pikk-poket commented on Nov 2, 2026

    @pikk-poket

    Same here, confirming @Lawkss’s observation with two months of data.

    Nextcloud: 35.0.2 — serverinfo: 7.0.0 — MariaDB: 11.8.9

    My instance runs with tmp_table_size = 128M and max_heap_table_size = 128M, and the check still fails. The config snippet offered by the check suggests:

    [mysqld]
    tmp_table_size = 64M

    Applying it would halve the current value. The snippet does not take the running configuration into account.

    Beyond the suggestion itself, I don’t think this check can pass on MariaDB at all. MariaDB always materialises a temporary table on disk when it contains a TEXT or BLOB column, regardless of the configured memory, because the in-memory engine cannot handle variable-length columns — MySQL 8 solved this by moving to the TempTable engine. Nextcloud’s schema uses such columns extensively (oc_filecache.path, properties, Talk messages), so a large share of temp tables will always spill to disk on MariaDB.

    @Lawkss and I both run 128M and both still see the warning, which supports the idea that the ratio is not driven by the configured size at all.

    Over the past two months the ratio on my instance has stayed between 50% and 65%, with no correlation to actual performance: the slow query log has been empty for weeks and database latency sits around 1.3 ms.

    Suggestion: skip or downgrade this check on MariaDB, and never suggest a value lower than the one currently configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions