Re: Index usage question

From: "Norbert Zoltan Toth" <Norbert(dot)Zoltan(dot)Toth(at)cern(dot)ch>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Index usage question
Date: 2001-09-04 18:52:56
Message-ID: 014101c13572$cfbc1bc0$11278a89@cern.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have experienced the following problem, maybe they are related:

I create a table with
create table test (id int, name char(10));

then I create an index on it with
create index test_idx on test (id);

After populating my table, the query
select id from test where id='1';

uses index scan.

However when I only create the index AFTER inserting rows into the table,
the index is not being used for the evaluation,
even if I run vacuum / vaccum analyze on test;

I would also appreciate some help with this.

Thank you,
Norbert

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message bpalmer 2001-09-04 19:12:17 Re: SHOW
Previous Message Tom Lane 2001-09-04 18:31:34 Re: Index usage question