Skip site navigation (1) Skip section navigation (2)

Re: PG8.2.1 choosing slow seqscan over idx scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jeremy Haile" <jhaile(at)fastmail(dot)fm>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: PG8.2.1 choosing slow seqscan over idx scan
Date: 2007-01-16 21:39:07
Message-ID: 26412.1168983547@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Jeremy Haile" <jhaile(at)fastmail(dot)fm> writes:
> Running PostgreSQL 8.2.1 on Win32.   The query planner is choosing a seq
> scan over index scan even though index scan is faster (as shown by
> disabling seqscan).  Table is recently analyzed and row count estimates
> seem to be in the ballpark.

Try reducing random_page_cost a bit.  Keep in mind that you are probably
measuring a fully-cached situation here, if you repeated the test case.
If your database fits into memory reasonably well then that's fine and
you want to optimize for that case ... but otherwise you may find
yourself pessimizing the actual behavior.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Jeremy HaileDate: 2007-01-16 22:20:53
Subject: Re: PG8.2.1 choosing slow seqscan over idx scan
Previous:From: Jeremy HaileDate: 2007-01-16 21:23:00
Subject: PG8.2.1 choosing slow seqscan over idx scan

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group