Re: Worthwhile optimisation of position()? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Worthwhile optimisation of position()?
Date
Msg-id 28782.1143182898@sss.pgh.pa.us
Whole thread Raw
In response to Re: Worthwhile optimisation of position()?  (Tim Allen <tim@proximity.com.au>)
Responses Re: Worthwhile optimisation of position()?  (Thomas Hallgren <thomas@tada.se>)
Re: Worthwhile optimisation of position()?  (Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>)
List pgsql-hackers
Tim Allen <tim@proximity.com.au> writes:
> Thomas Hallgren wrote:
>> The position function must look for 'ch' everywhere in the string so 
>> there's no way it can use an index.

> I think the '= 0' bit is what Chris was suggesting could be the basis 
> for an optimisation.

Yeah.  AFAICS the transformation Chris suggested is valid.  I'm really
dubious that it's worth expending planner cycles to look for it though.
LIKE is something that everybody and his brother uses, but who uses this
position()=0 locution?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tim Allen
Date:
Subject: Re: Worthwhile optimisation of position()?
Next
From: Thomas Hallgren
Date:
Subject: Re: Worthwhile optimisation of position()?