Re: Index optimization ? - Mailing list pgsql-general

From Ragnar Hafstað
Subject Re: Index optimization ?
Date
Msg-id 1105894541.32063.22.camel@localhost.localdomain
Whole thread Raw
In response to Re: Index optimization ?  (Bo Lorentsen <bl@netgroup.dk>)
Responses Re: Index optimization ?
List pgsql-general
On Sun, 2005-01-16 at 17:45 +0100, Bo Lorentsen wrote:
> Ragnar Hafstað wrote:
> >when a volatile function is used thus:
> >  SELECT * FROM mytable WHERE col=myvolatilefunc();
> >the planner must call the function once per table row, and assume
> >possibly different return values each time, so an indexscan will
> >not improve timings.
> >
> >
> Why not use the index scan for every row, is this a "limit" in the
> planner ? I think there is something in the planner I don't understand :-)

the planner will just use the plan it estimates will be fastest.
because of how indexscans work in postgresql, in this case it would be
slower than a tablescan (assuming the function really is volatile)

gnari



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Index optimization ?
Next
From: Roman Neuhauser
Date:
Subject: Re: Index optimization ?