Re: Regex performance regression induced by match-all code

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: Regex performance regression induced by match-all code
Дата
Msg-id fc07bb1e-b55b-49e3-a55d-bc47b5ac828c@www.fastmail.com
обсуждение исходный текст
Ответ на Re: Regex performance regression induced by match-all code  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Regex performance regression induced by match-all code  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, May 2, 2021, at 18:53, Tom Lane wrote:
fix-exponential-cost-of-checkmatchall-2.patch

Successfully tested.

SELECT
  is_match <> (subject ~ pattern),
  captured IS DISTINCT FROM regexp_match(subject, pattern, flags),
  COUNT(*)
FROM performance_test
GROUP BY 1,2
ORDER BY 1,2;
?column? | ?column? |  count
----------+----------+---------
f        | f        | 3253889
(1 row)

Time: 94149.542 ms (01:34.150)
Time: 91565.305 ms (01:31.565)
Time: 91565.305 ms (01:31.565)

SELECT regexp_matches('', '(.|){20}','');
regexp_matches
----------------
{""}
(1 row)

Time: 0.541 ms

SELECT regexp_matches('', '(.|){25}','');
regexp_matches
----------------
{""}
(1 row)

Time: 0.724 ms

SELECT regexp_matches('', '(.|){27}','');
regexp_matches
----------------
{""}
(1 row)

Time: 0.782 ms

/Joel

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: PG in container w/ pid namespace is init, process exits cause restart
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PG in container w/ pid namespace is init, process exits cause restart