Re: Creating index does not make any change in query plan.

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Creating index does not make any change in query plan.
Date: 2003-02-17 08:36:55
Message-ID: 3E50EC7F.5180.8F640EB@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 17 Feb 2003 at 14:15, Deepa wrote:

> Hi Shridhar,
> Its 100,000 records.
>
> Thanks a lot. When I do a select as explained by you I can able to
> see the difference between Query plan for indexed and non indexed columns.
>
> Here an integer used as a string. Why when it selected as a
> integer, the query plan doesn't do a index scan, but when selected as a string,
> the query planner uses index scan. What could be the possible reason?

It is very simple. Unless the indexed field and the field in query does not
match exactly in type, the planner does not consider using index.

What would be good in planner is to have field promotion like in C/C++,
smallint->bigint->float->double as and when required. That would help a hell
lot many people..

Bye
Shridhar

--
aquadextrous, adj.: Possessing the ability to turn the bathtub faucet on and
off with your toes. -- Rich Hall, "Sniglets"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Deepa 2003-02-17 08:45:04 Re: Creating index does not make any change in query plan.
Previous Message Deepa 2003-02-17 08:32:01 Re: Creating index does not make any change in query plan.