Re: Performs WAY better with enable_seqscan = off - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Performs WAY better with enable_seqscan = off
Date
Msg-id 20060522152549.GO64371@pervasive.com
Whole thread Raw
In response to Re: Performs WAY better with enable_seqscan = off  (Brendan Duddridge <brendan@clickspace.com>)
List pgsql-performance
On Sun, May 21, 2006 at 02:01:14PM -0600, Brendan Duddridge wrote:
> When the query planner uses the indexes with the concatenated values
> and the where clause, the query can be sub-second response times (but
> not always depending on the category_id value). By just doing a
> regular join as you suggested, it's always slower. The trick is
> getting Postgres to use the proper index all the time. And so far the
> only way I can do that is by turning off sequential scans, but that's
> something I didn't want to do because I don't know how it would
> affect the performance of the rest of my application.

You can always disable them for just that query...
BEGIN;
SET LOCAL enable_seqscan=off;
SELECT ...
COMMIT;

> Just a note, I have random_page_cost set to 1 to try and get it to
> favour index scans. The database machine has 8GB of RAM and I have
> effective_cache_size set to 2/3 of that.

That's rather low for that much memory; I'd set it to 7GB.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: utilizing multiple disks for i/o performance
Next
From: Markus Schaber
Date:
Subject: Re: How can I make this query faster (resend)