Re: text_pattern_ops and complex regexps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: text_pattern_ops and complex regexps
Дата
Msg-id 6424.1241623206@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: text_pattern_ops and complex regexps  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: text_pattern_ops and complex regexps  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> (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.

See regex_fixed_prefix(), but it's a pretty hard problem without writing
a complete regex parser.

> 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.

I wouldn't see why.  It's certainly worth considering to hand the
pattern to the regex engine and then burrow into the data structure it
builds; but right now we consider that structure to be entirely private
to backend/regex/.  There's also the problem that we'd have no easy
way to determine how much the result depends on the current regex flavor
setting.  There are some cases now where regex_fixed_prefix deliberately
omits possible optimizations because of uncertainty about the flavor.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: bytea vs. pg_dump
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: bytea vs. pg_dump