@@ -84,7 +84,7 @@ static MemoryContext anl_context = NULL;
8484static BufferAccessStrategy vac_strategy ;
8585
8686
87- static void do_analyze_rel (Relation onerel , int options ,
87+ static void do_analyze_rel (Relation onerel ,
8888 VacuumParams * params , List * va_cols ,
8989 AcquireSampleRowsFunc acquirefunc , BlockNumber relpages ,
9090 bool inh , bool in_outer_xact , int elevel );
@@ -115,7 +115,7 @@ static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
115115 * use it once we've successfully opened the rel, since it might be stale.
116116 */
117117void
118- analyze_rel (Oid relid , RangeVar * relation , int options ,
118+ analyze_rel (Oid relid , RangeVar * relation ,
119119 VacuumParams * params , List * va_cols , bool in_outer_xact ,
120120 BufferAccessStrategy bstrategy )
121121{
@@ -125,7 +125,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
125125 BlockNumber relpages = 0 ;
126126
127127 /* Select logging level */
128- if (options & VACOPT_VERBOSE )
128+ if (params -> options & VACOPT_VERBOSE )
129129 elevel = INFO ;
130130 else
131131 elevel = DEBUG2 ;
@@ -147,8 +147,8 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
147147 *
148148 * Make sure to generate only logs for ANALYZE in this case.
149149 */
150- onerel = vacuum_open_relation (relid , relation , params ,
151- options & ~( VACOPT_VACUUM ) ,
150+ onerel = vacuum_open_relation (relid , relation , params -> options & ~( VACOPT_VACUUM ) ,
151+ params -> log_min_duration >= 0 ,
152152 ShareUpdateExclusiveLock );
153153
154154 /* leave if relation could not be opened or locked */
@@ -165,7 +165,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
165165 */
166166 if (!vacuum_is_relation_owner (RelationGetRelid (onerel ),
167167 onerel -> rd_rel ,
168- options & VACOPT_ANALYZE ))
168+ params -> options & VACOPT_ANALYZE ))
169169 {
170170 relation_close (onerel , ShareUpdateExclusiveLock );
171171 return ;
@@ -237,7 +237,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
237237 else
238238 {
239239 /* No need for a WARNING if we already complained during VACUUM */
240- if (!(options & VACOPT_VACUUM ))
240+ if (!(params -> options & VACOPT_VACUUM ))
241241 ereport (WARNING ,
242242 (errmsg ("skipping \"%s\" --- cannot analyze non-tables or special system tables" ,
243243 RelationGetRelationName (onerel ))));
@@ -257,14 +257,14 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
257257 * tables, which don't contain any rows.
258258 */
259259 if (onerel -> rd_rel -> relkind != RELKIND_PARTITIONED_TABLE )
260- do_analyze_rel (onerel , options , params , va_cols , acquirefunc ,
260+ do_analyze_rel (onerel , params , va_cols , acquirefunc ,
261261 relpages , false, in_outer_xact , elevel );
262262
263263 /*
264264 * If there are child tables, do recursive ANALYZE.
265265 */
266266 if (onerel -> rd_rel -> relhassubclass )
267- do_analyze_rel (onerel , options , params , va_cols , acquirefunc , relpages ,
267+ do_analyze_rel (onerel , params , va_cols , acquirefunc , relpages ,
268268 true, in_outer_xact , elevel );
269269
270270 /*
@@ -292,7 +292,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
292292 * appropriate acquirefunc for each child table.
293293 */
294294static void
295- do_analyze_rel (Relation onerel , int options , VacuumParams * params ,
295+ do_analyze_rel (Relation onerel , VacuumParams * params ,
296296 List * va_cols , AcquireSampleRowsFunc acquirefunc ,
297297 BlockNumber relpages , bool inh , bool in_outer_xact ,
298298 int elevel )
@@ -603,7 +603,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
603603 * VACUUM ANALYZE, don't overwrite the accurate count already inserted by
604604 * VACUUM.
605605 */
606- if (!inh && !(options & VACOPT_VACUUM ))
606+ if (!inh && !(params -> options & VACOPT_VACUUM ))
607607 {
608608 for (ind = 0 ; ind < nindexes ; ind ++ )
609609 {
@@ -634,7 +634,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
634634 (va_cols == NIL ));
635635
636636 /* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */
637- if (!(options & VACOPT_VACUUM ))
637+ if (!(params -> options & VACOPT_VACUUM ))
638638 {
639639 for (ind = 0 ; ind < nindexes ; ind ++ )
640640 {
0 commit comments