Re: text_pattern_ops and complex regexps

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: text_pattern_ops and complex regexps
Date: 2009-05-06 15:04:49
Message-ID: 20090506150449.GV8123@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2009-05-06 15:18:28 Re: bytea vs. pg_dump
Previous Message Tom Lane 2009-05-06 15:00:06 Re: text_pattern_ops and complex regexps