Re: what is the cause that scan type is showing as 'seq scan' after indexing - Mailing list pgsql-admin

From Ross J. Reedstrom
Subject Re: what is the cause that scan type is showing as 'seq scan' after indexing
Date
Msg-id 20030126164418.GB20331@wallace.ece.rice.edu
Whole thread Raw
In response to what is the cause that scan type is showing as 'seq scan' after indexing  ("shreedhar" <shreedhar@lucidindia.net>)
List pgsql-admin
On Sun, Jan 26, 2003 at 06:31:50PM +0530, shreedhar wrote:
> Hi All,
>
> Before indexing query plan was showing cost as 40.00, after indexing query
> plan again showing as 'seq scan' and cost as 3060.55.
> The field which i indexed is primary key to this table.
> May i know
> 1) what is the cause that scan type is showing as 'seq scan' after indexing
> also
> 2) why it is showing cost as high value compare to previous.

You trimmed out the other parts of the EXPLAIN, so I'm just guessing,
but that cost seems suspiciously round: I'm guessing that you haven't
run VACUUM ANALYZE at all. One thing indexing does is update the 'number
of tuples' statistic. See the archives for why sequential scans still
show up (short answer: index scans aren't free, so at some point, it's
cheaper to scan the entire table than to scan both the index and the
subset of the table returned)

Ross

pgsql-admin by date:

Previous
From: "shreedhar"
Date:
Subject: what is the cause that scan type is showing as 'seq scan' after indexing
Next
From: Bruce Momjian
Date:
Subject: Re: Password Encryption