Re: help with getting index scan - Mailing list pgsql-general

From Doug McNaught
Subject Re: help with getting index scan
Date
Msg-id m3lmdhzh3g.fsf@varsoon.denali.to
Whole thread Raw
In response to help with getting index scan  ("Thomas T. Thai" <tom@minnesota.com>)
Responses Re: help with getting index scan
List pgsql-general
"Thomas T. Thai" <tom@minnesota.com> writes:

> On 25 Feb 2002, Doug McNaught wrote:
> > Well, EXPLAIN is indicating (unless I misread it) that the estimate of
> > rows returned is 336702, so it's not surprising that it opts for a
> > sequential scan.  Is this under 7.1 or 7.2?  The latter keeps much
> > better statistics about table populations...
>
> this is under 7.2. is there away to force it to use index scan? cause
> right now when i'm searching using a cat reference, it's taking a few
> seconds.

I'm still suspicious that something is wrong, but you can do

SET enable_seqscan TO off;

before your query and see if it helps your performance.  If it makes a
significant difference let us know--Tom may be interested in trying to
improve the statistics.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Backup & Restore
Next
From: Tom Lane
Date:
Subject: Re: tcpip_socket vs -i