kernelci / kcidb

kernelci.org common database tools
GNU General Public License v2.0
27 stars 33 forks source link

PostgreSQL: Consider lowering random_page_cost #551

Closed spbnick closed 1 month ago

spbnick commented 2 months ago

It turns out that the PostgreSQL instances we're deploying in Google Cloud, on SSDs, have the random_page_cost option set to 4, whereas the seq_page_cost is set to 1. This difference might be too high for an SSD (as opposed to an HDD), and incorrectly skews PostgreSQL preferences to sequential scans instead of e.g. Bitmap Index Scans, slowing down the queries unnecessarily. Consider lowering it to e.g. 2, or maybe even 1.

spbnick commented 2 months ago

ChatGPT about random_page_cost:

Recommended Value for SSD: 1.1 to 1.5

spbnick commented 1 month ago

We had this set to 1.5 for a while, without much impact, seemingly.