@@ -84,7 +84,7 @@ static MemoryContext anl_context = NULL;
84
84
static BufferAccessStrategy vac_strategy ;
85
85
86
86
87
- static void do_analyze_rel (Relation onerel , int options ,
87
+ static void do_analyze_rel (Relation onerel ,
88
88
VacuumParams * params , List * va_cols ,
89
89
AcquireSampleRowsFunc acquirefunc , BlockNumber relpages ,
90
90
bool inh , bool in_outer_xact , int elevel );
@@ -115,7 +115,7 @@ static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
115
115
* use it once we've successfully opened the rel, since it might be stale.
116
116
*/
117
117
void
118
- analyze_rel (Oid relid , RangeVar * relation , int options ,
118
+ analyze_rel (Oid relid , RangeVar * relation ,
119
119
VacuumParams * params , List * va_cols , bool in_outer_xact ,
120
120
BufferAccessStrategy bstrategy )
121
121
{
@@ -125,7 +125,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
125
125
BlockNumber relpages = 0 ;
126
126
127
127
/* Select logging level */
128
- if (options & VACOPT_VERBOSE )
128
+ if (params -> options & VACOPT_VERBOSE )
129
129
elevel = INFO ;
130
130
else
131
131
elevel = DEBUG2 ;
@@ -147,8 +147,8 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
147
147
*
148
148
* Make sure to generate only logs for ANALYZE in this case.
149
149
*/
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 ,
152
152
ShareUpdateExclusiveLock );
153
153
154
154
/* leave if relation could not be opened or locked */
@@ -165,7 +165,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
165
165
*/
166
166
if (!vacuum_is_relation_owner (RelationGetRelid (onerel ),
167
167
onerel -> rd_rel ,
168
- options & VACOPT_ANALYZE ))
168
+ params -> options & VACOPT_ANALYZE ))
169
169
{
170
170
relation_close (onerel , ShareUpdateExclusiveLock );
171
171
return ;
@@ -237,7 +237,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
237
237
else
238
238
{
239
239
/* No need for a WARNING if we already complained during VACUUM */
240
- if (!(options & VACOPT_VACUUM ))
240
+ if (!(params -> options & VACOPT_VACUUM ))
241
241
ereport (WARNING ,
242
242
(errmsg ("skipping \"%s\" --- cannot analyze non-tables or special system tables" ,
243
243
RelationGetRelationName (onerel ))));
@@ -257,14 +257,14 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
257
257
* tables, which don't contain any rows.
258
258
*/
259
259
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 ,
261
261
relpages , false, in_outer_xact , elevel );
262
262
263
263
/*
264
264
* If there are child tables, do recursive ANALYZE.
265
265
*/
266
266
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 ,
268
268
true, in_outer_xact , elevel );
269
269
270
270
/*
@@ -292,7 +292,7 @@ analyze_rel(Oid relid, RangeVar *relation, int options,
292
292
* appropriate acquirefunc for each child table.
293
293
*/
294
294
static void
295
- do_analyze_rel (Relation onerel , int options , VacuumParams * params ,
295
+ do_analyze_rel (Relation onerel , VacuumParams * params ,
296
296
List * va_cols , AcquireSampleRowsFunc acquirefunc ,
297
297
BlockNumber relpages , bool inh , bool in_outer_xact ,
298
298
int elevel )
@@ -603,7 +603,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
603
603
* VACUUM ANALYZE, don't overwrite the accurate count already inserted by
604
604
* VACUUM.
605
605
*/
606
- if (!inh && !(options & VACOPT_VACUUM ))
606
+ if (!inh && !(params -> options & VACOPT_VACUUM ))
607
607
{
608
608
for (ind = 0 ; ind < nindexes ; ind ++ )
609
609
{
@@ -634,7 +634,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
634
634
(va_cols == NIL ));
635
635
636
636
/* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */
637
- if (!(options & VACOPT_VACUUM ))
637
+ if (!(params -> options & VACOPT_VACUUM ))
638
638
{
639
639
for (ind = 0 ; ind < nindexes ; ind ++ )
640
640
{
0 commit comments