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

Commit7f848cb

Browse files
Remove superfluous autoprewarm check
autoprewarm_database_main() prewarms blocks from the same database. Itis passed an array of sorted BlockInfoRecords and a start and stop indexinto the array. The range represented should include only blocksbelonging to global objects or blocks from a single database. Remove anunnecessary check that the current block is from the same database andadd an assert to ensure this invariant remains. Doing so removes aspecial case that makes future refactoring to accommodate readstreamifying autoprewarm easier.Noticed off-list by Andres Freund
1 parentb3f1a13 commit7f848cb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎contrib/pg_prewarm/autoprewarm.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,10 @@ autoprewarm_database_main(Datum main_arg)
463463
CHECK_FOR_INTERRUPTS();
464464

465465
/*
466-
*Quit if we've reached records for another database. If previous
467-
*blocks are of someglobal objects, then continue pre-warming.
466+
*All blocks between prewarm_start_idx and prewarm_stop_idx should
467+
*belong either toglobal objects or the same database.
468468
*/
469-
if (old_blk!=NULL&&old_blk->database!=blk->database&&
470-
old_blk->database!=0)
471-
break;
469+
Assert(blk->database==apw_state->database||blk->database==0);
472470

473471
/*
474472
* As soon as we encounter a block of a new relation, close the old

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp