Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36784e9

Browse files
committed
Improve inefficient regexes in vacuumdb TAP test.
The regexes used in 102_vacuumdb_stages.pl to check the postmaster logfor expected output contained several places with ".*.*", which isunderdetermined and can cause exponential runtime growth in Perl's regexmatcher (since it's not bright enough not to waste time seeing whetherdifferent splits of the same substring would allow a match). We werefortunate that the amount of text in the postmaster log was generally notenough to make the runtime go to the moon; although commit6271fce hadbeen on the hairy edge of an obvious problem, thanks to its increasing thedefault log verbosity to DEBUG1. Experimentation shows that anyone whotried to run this test case with an even higher log verbosity would havebeen in for serious pain. But even at default logging level, fixing thissaves several hundred ms on my workstation, more on slower buildfarmmembers.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 anyonetries to do related debugging in a back branch.Discussion:https://postgr.es/m/32459.1525657786@sss.pgh.pa.us
1 parent2f895f7 commit36784e9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎src/bin/scripts/t/102_vacuumdb_stages.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010

1111
$node->issues_sql_like(
1212
['vacuumdb','--analyze-in-stages','postgres' ],
13-
qr/.*statement:\SET\default_statistics_target=1;\SET\vacuum_cost_delay=0;
14-
.*statement:\ANALYZE.*
13+
qr/statement:\SET\default_statistics_target=1;\SET\vacuum_cost_delay=0;
14+
.*statement:\ANALYZE
1515
.*statement:\SET\default_statistics_target=10;\RESET\vacuum_cost_delay;
16-
.*statement:\ANALYZE.*
16+
.*statement:\ANALYZE
1717
.*statement:\RESET\default_statistics_target;
1818
.*statement:\ANALYZE/sx,
1919
'analyze three times');
2020

2121
$node->issues_sql_like(
2222
['vacuumdb','--analyze-in-stages','--all' ],
23-
qr/.*statement:\SET\default_statistics_target=1;\SET\vacuum_cost_delay=0;
24-
.*statement:\ANALYZE.*
23+
qr/statement:\SET\default_statistics_target=1;\SET\vacuum_cost_delay=0;
24+
.*statement:\ANALYZE
2525
.*statement:\SET\default_statistics_target=1;\SET\vacuum_cost_delay=0;
26-
.*statement:\ANALYZE.*
26+
.*statement:\ANALYZE
2727
.*statement:\SET\default_statistics_target=10;\RESET\vacuum_cost_delay;
28-
.*statement:\ANALYZE.*
28+
.*statement:\ANALYZE
2929
.*statement:\SET\default_statistics_target=10;\RESET\vacuum_cost_delay;
30-
.*statement:\ANALYZE.*
30+
.*statement:\ANALYZE
3131
.*statement:\RESET\default_statistics_target;
32-
.*statement:\ANALYZE.*
32+
.*statement:\ANALYZE
3333
.*statement:\RESET\default_statistics_target;
3434
.*statement:\ANALYZE/sx,
3535
'analyze more than one database in stages');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp