I too did the similar type of test and got the same result. Will any one
tell me what could be possible solution for this.
--
Bye,
Deepa. K
--
Engineer,
Network Management System,
Midas Communication Technologies private Ltd,
Chennai.
---------- Forwarded message ----------
Date: Mon, 17 Feb 2003 13:45:21 -0800
From: John Edstrom <edstrom@jnrcom.com>
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Creating index does not make any change in query
plan.
I don't think that this will solve the problem. I've uncovered a
similar problem recently. Vacuuming invalidates indexes, at
least as far as I can tell. Here is an example:
----------------------------------------------------------------------
web=# create table t1 ( i int primary key );
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
't1_pkey' for table 't1'
CREATE
web=# explain select * from t1 where i = 10;
NOTICE: QUERY PLAN:
Index Scan using t1_pkey on t1 (cost=0.00..4.82 rows=1 width=4)
EXPLAIN
web=# vacuum analyze t1;
VACUUM
web=# explain select * from t1 where i = 10;
NOTICE: QUERY PLAN:
Seq Scan on t1 (cost=0.00..0.00 rows=1 width=4)
EXPLAIN
web=# reindex table t1;
REINDEX
web=# explain select * from t1 where i = 10;
NOTICE: QUERY PLAN:
Index Scan using t1_pkey on t1 (cost=0.00..4.82 rows=1 width=4)
EXPLAIN
--------------------------------------------------------------------
That is not what I expected to happen.
> Hope this helps,
--
John Edstrom
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster