Nextcloud database optimalization


Is there any way to optimalize a nextcloud database?

My DB (postgres) is more than 1 GB big, data storage contains 230 GB of data. I think It causes slower perfomance.

Any idea, please?
Thanks in advance,

The first things you can do is confirm there are no db index warnings under Admin->Basic Settings.


  1. Follow the advice in the Server Tuning section of the Admin Manual (not just for the db).
  2. Disable unnecessary NC apps, particularly ones that have a lot of overhead like - e.g. antivirus, office previews - if you feel you can live without them
  3. Share details of your setup here and others may have feedback and ideas (for example: I posted benchmarks comparing Alpine based Docker containers for Redis that showed significant performance differences by ditching Alpine)
  4. Rather than guessing, take a look at things like htop, iostat, vmstat, etc. during particularly slow use cases to learn what the constraints are in your environment

Thank you for reply, jtr.

I’ve tried all the steps from Server tunning part of the manual, none of them made any bigger improvement in my environment.

Then I rebuilt the database by creating a new db from sql dump and dropping the old one. The DB size reduced by a third. I’ve also doubled memory limit and cut off some unused external storages and the performance seems to be better so far.

It is already some time now - the DB size is back on its original size - but the overall performance is still better than before.

Thanks though.
Have a nice day.