Content-Length: 263125 | pFad | http://github.com/postgrespro/postgres/commit/32fbe0239b03d868744758d5809eaf74f19c924d

54 Only make buffer strategy for vacuum when it's likely needed · postgrespro/postgres@32fbe02 · GitHub
Skip to content

Commit 32fbe02

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 vacuum strategy ring created in vacuum(), so don't waste effort making it in those cases. There are other conceivable cases where the buffer strategy also won't be used, but those are probably less common and not worth troubling over too much. For example VACUUM (PROCESS_MAIN false, PROCESS_TOAST false). There are other cases too, but many of these are only discovered once inside vacuum_rel(). Author: Melanie Plageman Reviewed-by: David Rowley Discussion: https://postgr.es/m/CAAKRu_ZLRuzkM3zKogiZAz2hUony37yLY4aaLb8fPf8fgqs5Og@mail.gmail.com
1 parent 1980d35 commit 32fbe02

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
MemoryContext old_context = MemoryContextSwitchTo(vac_context);
399401

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/32fbe0239b03d868744758d5809eaf74f19c924d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy