Hello, |m using version 27, and root directory have 237k of catalogs, when Im trying to open by https its loading about 2 hours, in mariadb slow-log I see that queries:
In the default config, you have a few cache size settings. A few things are here on the official documentation:
https://docs.nextcloud.com/server/27/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database
Regarding your specific database, you can use tuning-primer.sh and/or mysqltuner.pl to get recommendation how to optimize cache size for your setup.
And if you have not yet used memory caching, this takes away some load from the database: Memory caching — Nextcloud latest Administration Manual latest documentation
And NC27 is not supported any more. Try to upgrade to at least NC 28 soon (check before the requirements and if your most important apps are still supported, especially when you go to more current ones).