Assorted trivial cleanup of c5c239e26e
authorMelanie Plageman <melanieplageman@gmail.com>
Fri, 21 Mar 2025 18:05:21 +0000 (14:05 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Fri, 21 Mar 2025 18:06:40 +0000 (14:06 -0400)
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().

src/backend/access/nbtree/nbtree.c

index 353600414a2db4778acff68ec05392b7504d0494..80b04d6ca2ac2fd0537bbf3088d960de0c87400c 100644 (file)
@@ -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);