Re: avoiding seqscan? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: avoiding seqscan?
Date
Msg-id 200309281434.25881.josh@agliodbs.com
Whole thread Raw
In response to avoiding seqscan?  (Palle Girgensohn <girgen@pingpong.net>)
Responses Re: avoiding seqscan?  (Palle Girgensohn <girgen@pingpong.net>)
List pgsql-performance
Palle,

> I have a SQL statement that I cannot get to use the index. postgresql
> insists on using a seqscan and performance is very poor. set enable_seqscan
> = true boost performance drastically, as you can see below. Since seqscan
> is not always bad, I'd rather not turn it off completely, but rather get
> the planner to do the right thing here. Is there another way to do this,
> apart from setting enable_seqscan=false?

In your postgresql.conf, try setting effective_cache_size to something like
50% of your system's RAM, and lovering random_page_cost to 2.0 or even 1.5.
Then restart PostgreSQL and try your query again.

What version, btw?


--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-performance by date:

Previous
From: Palle Girgensohn
Date:
Subject: avoiding seqscan?
Next
From: Palle Girgensohn
Date:
Subject: Re: avoiding seqscan?