Re: Helping planner to chose sequential scan when it improves performance

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: "Patrick O'Toole" <patrick.otoole@sturdy.ai>
Cc: pgsql-general@postgresql.org
Date: 2023-06-25T19:48:27Z
Lists: pgsql-performance
On Wed, 14 Jun 2023 at 07:28, Patrick O'Toole <patrick.otoole@sturdy.ai> wrote:
> Maybe we are barking up the wrong tree with the previous questions. Are there other configuration parameters we should consider first to improve performance in situations like the one illustrated?

random_page_cost and effective_cache_size are the main settings which
will influence plan A vs plan B.  Larger values of
effective_cache_size will have the planner apply more seq_page_costs
to the index scan.  Lower values of effective_cache_size will mean
more pages will be assumed to cost random_page_cost.

David