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.
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 theseq_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.