Postgres SSD optimization

If you’re running your database on an SSD instead of a spinning disk, you might want to optimize postgres table space cost:


-- Change the tablespace cost
ALTER TABLESPACE pg_default SET ( seq_page_cost = 20, random_page_cost = 1 );
-- Verifiy the change
SELECT * FROM pg_tablespace;

-- Undo the tablespace cost
ALTER TABLESPACE pg_default RESET ( seq_page_cost, random_page_cost);
-- Verifiy the change
SELECT * FROM pg_tablespace;

Leave a Reply

Your email address will not be published. Required fields are marked *


5 − two =