pgsql: Improve inefficient regexes in vacuumdb TAP test.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Improve inefficient regexes in vacuumdb TAP test.
Дата
Msg-id E1fGCny-0004Kh-AT@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Improve inefficient regexes in vacuumdb TAP test.

The regexes used in 102_vacuumdb_stages.pl to check the postmaster log
for expected output contained several places with ".*.*", which is
underdetermined and can cause exponential runtime growth in Perl's regex
matcher (since it's not bright enough not to waste time seeing whether
different splits of the same substring would allow a match).  We were
fortunate that the amount of text in the postmaster log was generally not
enough to make the runtime go to the moon; although commit 6271fceb8 had
been on the hairy edge of an obvious problem, thanks to its increasing the
default log verbosity to DEBUG1.  Experimentation shows that anyone who
tried to run this test case with an even higher log verbosity would have
been in for serious pain.  But even at default logging level, fixing this
saves several hundred ms on my workstation, more on slower buildfarm
members.

Remove the extra ".*"s, restoring more-or-less-linear matching speed.
Back-patch to 9.4 where the test case was added, mostly in case anyone
tries to do related debugging in a back branch.

Discussion: https://postgr.es/m/32459.1525657786@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/36784e9147face9624663d8165e008b46d31b3bc

Modified Files
--------------
src/bin/scripts/t/102_vacuumdb_stages.pl | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)


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

Предыдущее
От: pgsql@postgresql.org
Дата:
Сообщение: pgsql: Tag refs/tags/REL9_4_18 was created
Следующее
От: Teodor Sigaev
Дата:
Сообщение: pgsql: Improve jsonb cast error message