Re: help with getting index scan

From: "Thomas T(dot) Thai" <tom(at)minnesota(dot)com>
To: Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: help with getting index scan
Date: 2002-03-06 18:11:17
Message-ID: Pine.NEB.4.43.0203061209450.10216-100000@ns01.minnesota.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 7 Mar 2002, Masaru Sugawara wrote:

> > the query below still results in a seq scan:
> > ...
> > -> Seq Scan on phone_cat_address pca
> > (cost=0.00..5843.01 rows=336701 width=8)
> > (actual time=0.97..2875.06 rows=336701 loops=1)
> > -> Hash (cost=43.58..43.58 rows=11 width=4)
> > (actual time=3.91..3.91 rows=0 loops=1)
>
>
> It's a pity that the query use no index on phone_cat_address.

when i force it to use index scan, time drops down to ~800 ms.

> > Total runtime: 5240.28 msec
[...]
> Since phone_cat_address isn't limited by a WHERE cluse, etc., most of its
> rows will be selected. Therefore the planner seems to judge that a
> sequential scan is better/faster than an index scan.

--
Thomas T. Thai
Minnesota.com, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-03-06 18:28:04 Re: pbs with pg_dump
Previous Message Masaru Sugawara 2002-03-06 17:35:02 Re: help with getting index scan