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

Commit32fbe02

Browse files
committed
Only make buffer strategy for vacuum when it's likely needed
VACUUM FULL and VACUUM ONLY_DATABASE_STATS will not use the vacuumstrategy ring created in vacuum(), so don't waste effort making it inthose cases.There are other conceivable cases where the buffer strategy also won't beused, but those are probably less common and not worth troubling over toomuch. For example VACUUM (PROCESS_MAIN false, PROCESS_TOAST false).There are other cases too, but many of these are only discovered onceinside vacuum_rel().Author: Melanie PlagemanReviewed-by: David RowleyDiscussion:https://postgr.es/m/CAAKRu_ZLRuzkM3zKogiZAz2hUony37yLY4aaLb8fPf8fgqs5Og@mail.gmail.com
1 parent1980d35 commit32fbe02

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ vacuum(List *relations, VacuumParams *params,
393393
* If caller didn't give us a buffer strategy object, make one in the
394394
* cross-transaction memory context.
395395
*/
396-
if (bstrategy==NULL)
396+
if (bstrategy==NULL&&
397+
!(params->options&VACOPT_ONLY_DATABASE_STATS||
398+
params->options&VACOPT_FULL))
397399
{
398400
MemoryContextold_context=MemoryContextSwitchTo(vac_context);
399401

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp