Re: Index usage question - Mailing list pgsql-general

From Norbert Zoltan Toth
Subject Re: Index usage question
Date
Msg-id 014101c13572$cfbc1bc0$11278a89@cern.ch
Whole thread Raw
In response to Index usage question  (Jefim Matskin <mjefim@sphera.com>)
Responses Re: Index usage question
List 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


pgsql-general by date:

Previous
From: Francesco Casadei
Date:
Subject: Re: Catching errors inside a function
Next
From: Jan Wieck
Date:
Subject: Re: urgently wanted - plpgsql.so for pg 6.4.2