Re: Another regexp performance improvement: skip useless paren-captures

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Another regexp performance improvement: skip useless paren-captures
Дата
Msg-id 2390507.1628174181@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Another regexp performance improvement: skip useless paren-captures  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Another regexp performance improvement: skip useless paren-captures  (Mark Dilger <mark.dilger@enterprisedb.com>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> I'm a bit worried about how you'll keep track of back-ref numbering
> since back-refs only count capturing groups, and you're silently turning
> a capturing group into a non-capturing group.

They're already numbered at this point, and we aren't changing the numbers
of the capturing groups that remain live.  There will be unused entries in
the regmatch_t array at runtime (corresponding to the zapped groups), but
that doesn't cost anything worth mentioning.

Now that you mention it, I am not sure whether there are any regression
test cases that specifically cover still being able to match \2 when
the first capture group went away.  Probably should add more cases...

            regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Commitfest overflow
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: very long record lines in expanded psql output