Skip to main content
2 of 3
added 306 characters in body
guettli
  • 1.6k
  • 5
  • 24
  • 51

Autodetect ‘random_page_cost’ vs ‘seq_page_cost’

I read this article about PostgreSQL performance on SSD:

https://amplitude.engineering/how-a-single-postgresql-config-change-improved-slow-query-performance-by-50x-85593b8991b0

These two configurations seem to be important random_page_cost vs seq_page_cost

Since both parameters need to match the particular hardware I wonder if it is possible to automatically detect the matching values?

Update

I have these steps on my mind:

  1. Script creates some dummy tables
  2. Scripts inserts data to the tables
  3. Script does some queries
  4. Script shows matching values
  5. Human or an automated system takes these values and updates the config. This step is not part of the question.
guettli
  • 1.6k
  • 5
  • 24
  • 51