Re: help with getting index scan

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: Doug McNaught <doug(at)wireboard(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: help with getting index scan
Date: 2002-02-25 15:55:25
Message-ID: Pine.NEB.4.43.0202250943330.26810-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 25 Feb 2002, Doug McNaught wrote:

> > > Also, the estimate of rows returned from the phone_cat_address scan is
> > > pretty large--how large is the table itself? Sequential scan is
> > > actually faster if you're going to end up returning most of the rows
> > > in the table...
> >
> > yellowpages=# select count(*) from phone_cat_address;
> > count
> > --------
> > 336702
> > (1 row)
> >
> > type typical results should be a tiny fraction of that number.
>
> 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.

---
Thomas T. Thai | Minnesota.com | tom(at)minnesota(dot)com | 612.220.6220
Visit http://www.minnesota.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-02-25 16:00:51 Re: help with getting index scan
Previous Message Tom Lane 2002-02-25 15:55:16 Re: Need to vacuum multiple times for effectiveness?