* Tom Lane (t...@sss.pgh.pa.us) wrote:
> Stephen Frost <sfr...@snowman.net> writes:
> >   I don't see why the last case can't use the index.
> 
> The planner's understanding of regexps is far weaker than yours.
> 
> (In particular, I think it's set up to abandon optimization if it
> sees | anywhere.)

That's kind of what I figured from the empirical data.  My hope was that
it might be something which could be fixed.  Is this entirely the
planner's doing (eg: PG code)?  Perhaps this is misguided but I would
think that the regexp libraries might have some support for "give me all
anchored required text for this regexp" which we could then use in the
planner.  Certainly in an ideal world we wouldn't have to teach the
planner the knowledge that the regexp libraries include for this.

        Thoughts?

                Thanks,

                        Stephen

Attachment: signature.asc
Description: Digital signature

Reply via email to