@@ -423,7 +423,7 @@ typedef struct LVSavedErrInfo
423423/* non-export function prototypes */
424424static void lazy_scan_heap (LVRelState * vacrel );
425425static void heap_vacuum_eager_scan_setup (LVRelState * vacrel ,
426- VacuumParams * params );
426+ const VacuumParams params );
427427static BlockNumber heap_vac_scan_next_block (ReadStream * stream ,
428428 void * callback_private_data ,
429429 void * per_buffer_data );
@@ -485,7 +485,7 @@ static void restore_vacuum_error_info(LVRelState *vacrel,
485485 * vacuum options or for relfrozenxid/relminmxid advancement.
486486 */
487487static void
488- heap_vacuum_eager_scan_setup (LVRelState * vacrel , VacuumParams * params )
488+ heap_vacuum_eager_scan_setup (LVRelState * vacrel , const VacuumParams params )
489489{
490490 uint32 randseed ;
491491 BlockNumber allvisible ;
@@ -504,7 +504,7 @@ heap_vacuum_eager_scan_setup(LVRelState *vacrel, VacuumParams *params)
504504 vacrel -> eager_scan_remaining_successes = 0 ;
505505
506506 /* If eager scanning is explicitly disabled, just return. */
507- if (params -> max_eager_freeze_failure_rate == 0 )
507+ if (params . max_eager_freeze_failure_rate == 0 )
508508 return ;
509509
510510 /*
@@ -581,11 +581,11 @@ heap_vacuum_eager_scan_setup(LVRelState *vacrel, VacuumParams *params)
581581
582582 vacrel -> next_eager_scan_region_start = randseed % EAGER_SCAN_REGION_SIZE ;
583583
584- Assert (params -> max_eager_freeze_failure_rate > 0 &&
585- params -> max_eager_freeze_failure_rate <= 1 );
584+ Assert (params . max_eager_freeze_failure_rate > 0 &&
585+ params . max_eager_freeze_failure_rate <= 1 );
586586
587587 vacrel -> eager_scan_max_fails_per_region =
588- params -> max_eager_freeze_failure_rate *
588+ params . max_eager_freeze_failure_rate *
589589 EAGER_SCAN_REGION_SIZE ;
590590
591591 /*
@@ -612,7 +612,7 @@ heap_vacuum_eager_scan_setup(LVRelState *vacrel, VacuumParams *params)
612612 * and locked the relation.
613613 */
614614void
615- heap_vacuum_rel (Relation rel , VacuumParams * params ,
615+ heap_vacuum_rel (Relation rel , const VacuumParams params ,
616616 BufferAccessStrategy bstrategy )
617617{
618618 LVRelState * vacrel ;
@@ -634,9 +634,9 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
634634 ErrorContextCallback errcallback ;
635635 char * * indnames = NULL ;
636636
637- verbose = (params -> options & VACOPT_VERBOSE ) != 0 ;
637+ verbose = (params . options & VACOPT_VERBOSE ) != 0 ;
638638 instrument = (verbose || (AmAutoVacuumWorkerProcess () &&
639- params -> log_min_duration >= 0 ));
639+ params . log_min_duration >= 0 ));
640640 if (instrument )
641641 {
642642 pg_rusage_init (& ru0 );
@@ -699,9 +699,9 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
699699 * The truncate param allows user to avoid attempting relation truncation,
700700 * though it can't force truncation to happen.
701701 */
702- Assert (params -> index_cleanup != VACOPTVALUE_UNSPECIFIED );
703- Assert (params -> truncate != VACOPTVALUE_UNSPECIFIED &&
704- params -> truncate != VACOPTVALUE_AUTO );
702+ Assert (params . index_cleanup != VACOPTVALUE_UNSPECIFIED );
703+ Assert (params . truncate != VACOPTVALUE_UNSPECIFIED &&
704+ params . truncate != VACOPTVALUE_AUTO );
705705
706706 /*
707707 * While VacuumFailSafeActive is reset to false before calling this, we
@@ -711,22 +711,22 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
711711 vacrel -> consider_bypass_optimization = true;
712712 vacrel -> do_index_vacuuming = true;
713713 vacrel -> do_index_cleanup = true;
714- vacrel -> do_rel_truncate = (params -> truncate != VACOPTVALUE_DISABLED );
715- if (params -> index_cleanup == VACOPTVALUE_DISABLED )
714+ vacrel -> do_rel_truncate = (params . truncate != VACOPTVALUE_DISABLED );
715+ if (params . index_cleanup == VACOPTVALUE_DISABLED )
716716 {
717717 /* Force disable index vacuuming up-front */
718718 vacrel -> do_index_vacuuming = false;
719719 vacrel -> do_index_cleanup = false;
720720 }
721- else if (params -> index_cleanup == VACOPTVALUE_ENABLED )
721+ else if (params . index_cleanup == VACOPTVALUE_ENABLED )
722722 {
723723 /* Force index vacuuming. Note that failsafe can still bypass. */
724724 vacrel -> consider_bypass_optimization = false;
725725 }
726726 else
727727 {
728728 /* Default/auto, make all decisions dynamically */
729- Assert (params -> index_cleanup == VACOPTVALUE_AUTO );
729+ Assert (params . index_cleanup == VACOPTVALUE_AUTO );
730730 }
731731
732732 /* Initialize page counters explicitly (be tidy) */
@@ -789,7 +789,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
789789 */
790790 vacrel -> skippedallvis = false;
791791 skipwithvm = true;
792- if (params -> options & VACOPT_DISABLE_PAGE_SKIPPING )
792+ if (params . options & VACOPT_DISABLE_PAGE_SKIPPING )
793793 {
794794 /*
795795 * Force aggressive mode, and disable skipping blocks using the
@@ -830,7 +830,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
830830 * is already dangerously old.)
831831 */
832832 lazy_check_wraparound_failsafe (vacrel );
833- dead_items_alloc (vacrel , params -> nworkers );
833+ dead_items_alloc (vacrel , params . nworkers );
834834
835835 /*
836836 * Call lazy_scan_heap to perform all required heap pruning, index
@@ -947,9 +947,9 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
947947 {
948948 TimestampTz endtime = GetCurrentTimestamp ();
949949
950- if (verbose || params -> log_min_duration == 0 ||
950+ if (verbose || params . log_min_duration == 0 ||
951951 TimestampDifferenceExceeds (starttime , endtime ,
952- params -> log_min_duration ))
952+ params . log_min_duration ))
953953 {
954954 long secs_dur ;
955955 int usecs_dur ;
@@ -984,10 +984,10 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
984984 * Aggressiveness already reported earlier, in dedicated
985985 * VACUUM VERBOSE ereport
986986 */
987- Assert (!params -> is_wraparound );
987+ Assert (!params . is_wraparound );
988988 msgfmt = _ ("finished vacuuming \"%s.%s.%s\": index scans: %d\n" );
989989 }
990- else if (params -> is_wraparound )
990+ else if (params . is_wraparound )
991991 {
992992 /*
993993 * While it's possible for a VACUUM to be both is_wraparound
0 commit comments