summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelanie Plageman2025-03-21 18:05:21 +0000
committerMelanie Plageman2025-03-21 18:06:40 +0000
commit3f850c3fc5442084d13122be7f54335e4d017bef (patch)
treeb43f6a8ccc9824a0072653a90a6ba421a9b0ab86
parent7fe312f6092f47724a29e30fb2992bd2bc287687 (diff)
Assorted trivial cleanup of c5c239e26e
c5c239e26e made btree vacuum use the read stream API. Though it used functions declared in read_stream.h, it relied on transitively including it. Explicitly include that file. Also remove an extraneous newline and decrease the scope of one of the local variables in btvacuumscan().
-rw-r--r--src/backend/access/nbtree/nbtree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 353600414a2..80b04d6ca2a 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -30,6 +30,7 @@
#include "storage/indexfsm.h"
#include "storage/ipc.h"
#include "storage/lmgr.h"
+#include "storage/read_stream.h"
#include "utils/fmgrprotos.h"
#include "utils/index_selfuncs.h"
#include "utils/memutils.h"
@@ -1072,8 +1073,6 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
0);
for (;;)
{
- Buffer buf;
-
/* Get the current relation length */
if (needLock)
LockRelationForExtension(rel, ExclusiveLock);
@@ -1089,13 +1088,13 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
if (p.current_blocknum >= num_pages)
break;
-
p.last_exclusive = num_pages;
/* Iterate over pages, then loop back to recheck relation length */
while (true)
{
BlockNumber current_block;
+ Buffer buf;
/* call vacuum_delay_point while not holding any buffer lock */
vacuum_delay_point(false);