On Sat, Sep 11, 2004 at 02:30:35AM -0400, Greg Stark wrote:
> I don't know. I wrote code that did "LIKE ?||'%'" on Oracle tons of times and
> it always used an index scan. I was really impressed when I first checked
> whether that worked and really happy when it did. And it always ran just fine.
Note, this would have worked fine in previous versions of postgresql,
because there was no such thing as prepared statements so the plan
needed to be recreated for each query, thus it could take advantage of
all knowledge available in the query itself.
Kinda ironic that a seemingly very nice feature (seperating query from
arguments) has such a side-effect (less information for planner).
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.