2
votes

Creating a tablespace on an nvme disk improves performance?

I currently have postgres installed on an ssd disk and I bought an nvme disk to improve query and process performance, create a tablespace on the nvme disk and then create a database using that tablespace.

My question is whether this will really help make queries faster. the ssd has a speed of 500M / s vs 3000M / s that the nvme has, since I made some queries with the bd using the tablespace default in ssd vs bd with tablespace in nvme and there is not much difference

Is it necessary to install the prostgres on the nvme disk or is it not necessary?

Thanks for the help

1
I fond sometimes NVMe works counter-intuitively (slower than SATA SSD): bugs.mysql.com/bug.php?id=102514 - Tim He

1 Answers

3
votes

You don't have to install PostgreSQL on fast storage to speed it up, but placing the data directory on fast storage can only be good.

It is too late to tell you that, but investing in hardware is the last thing you do when tuning a database.

Fast disks will only help if your workload is I/O bound, and in your case it will at best improve speed by a factor of six. Creating the proper index can easily improve performance by a factor of 1000.

To make the best of your investment, set effective_io_concurrency and random_page_cost to reflect the physical properties of your storage, so that PostgreSQL can make the best of it.

The most cost effective kind of hardware tuning for databases is more RAM.