Re: text_pattern_ops and complex regexps - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: text_pattern_ops and complex regexps
Date
Msg-id 20090506150449.GV8123@tamriel.snowman.net
Whole thread Raw
In response to Re: text_pattern_ops and complex regexps  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: text_pattern_ops and complex regexps  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: text_pattern_ops and complex regexps
Next
From: Merlin Moncure
Date:
Subject: Re: bytea vs. pg_dump