Re: Index optimization ?

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Index optimization ?
Date: 2005-01-16 16:55:41
Message-ID: 1105894541.32063.22.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roman Neuhauser 2005-01-16 17:11:00 Re: Index optimization ?
Previous Message Martijn van Oosterhout 2005-01-16 16:48:08 Re: Index optimization ?