Re: Creating index does not make any change in query plan. - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Creating index does not make any change in query plan.
Date
Msg-id 3E50EC7F.5180.8F640EB@localhost
Whole thread Raw
In response to Re: Creating index does not make any change in query plan.  (Deepa <kdeepa@midascomm.com>)
Responses Re: Creating index does not make any change in query plan.
List 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"


pgsql-general by date:

Previous
From: Deepa
Date:
Subject: Re: Creating index does not make any change in query plan.
Next
From: Deepa
Date:
Subject: Re: Creating index does not make any change in query plan.