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

Commitbccd690

Browse files
committed
Always make a BufferAccessStrategy for ANALYZE
32fbe02 changed things so we didn't bother allocating theBufferAccessStrategy during VACUUM (ONLY_DATABASE_STATS); and VACUUM(FULL), however, it forgot to consider that VACUUM (FULL, ANALYZE) is apossible combination. That change would have resulted in such a commandallowing ANALYZE to make full use of shared buffers, which wasn'tintended, so fix that.Reported-by: Melanie PlagemanDiscussion:https://postgr.es/m/CAAKRu_bJRKe+v_=OqwC+5sA3j5qv8rqdAwy3+yHaO3wmtfrCRg@mail.gmail.com
1 parent1d477a9 commitbccd690

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,13 @@ 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. We needn't bother making this for
395395
* VACUUM (FULL) or VACUUM (ONLY_DATABASE_STATS) as they'll not make use
396-
* of it.
396+
* of it. VACUUM (FULL, ANALYZE) is possible, so we'd better ensure that
397+
* we make a strategy when we see ANALYZE.
397398
*/
398399
if (bstrategy==NULL&&
399-
(params->options& (VACOPT_ONLY_DATABASE_STATS |
400-
VACOPT_FULL))==0)
400+
((params->options& (VACOPT_ONLY_DATABASE_STATS |
401+
VACOPT_FULL))==0||
402+
(params->options&VACOPT_ANALYZE)!=0))
401403
{
402404
MemoryContextold_context=MemoryContextSwitchTo(vac_context);
403405

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp