How to optimize tables in MariaDB?

I have two tables in my MariaDB nextcloud database, which have become verrryy big:

oc_activity (16,5 Mb)
oc_filecache (48,8 MB)

My question is: Can I empty these tables without getting problems with my nextcloud? I have NC12.

Thanks for the answers!

I guess clearing the activity table should be painless, but dump a backup first.

The filecache table is not a cache in that way, more an index of all files in your users data folders. Empty it will lead at least to an empty files app in web ui, maybe syncing that also to all attached clients (?). So I would not recommend that!

You can clean the filecache from obsolete entries: sudo -u www-data php /path/to/nextcloud/occ files:cleanup
https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#file-operations-label

1 Like

Thanks so much, It was a great help for me!