Do you use the default location for the database? I found a cool middle ground that allowed me to run my operating system and snap off a ssd and the database on a slower hdd.
I installed nextcloud with snap and did the setup.
When everything was how I wanted it to be, I search for the datas location
(for me:/var/snap/nextcloud/common/nextcloud/data). Then I created a /data on my hdd and binded it to nextclouds /data folder.
My fstab now looks like this:
/data /var/snap/nextcloud/common/nextcloud/data none bind 0 0
You only have to rebuild the database:

nextcloud.occ files:cleanup
nextcloud.occ files:scan

!!! Important, move your data first to the new location.(I think you won’t lose it, but you cannot access it)