From: | "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu> |
---|---|
To: | Postgres <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: what is the cause that scan type is showing as 'seq scan' after indexing |
Date: | 2003-01-26 16:44:18 |
Message-ID: | 20030126164418.GB20331@wallace.ece.rice.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-01-26 23:51:36 | Re: Password Encryption |
Previous Message | shreedhar | 2003-01-26 13:01:50 | what is the cause that scan type is showing as 'seq scan' after indexing |