diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/index.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 022b9b99b13..739a92bdcc1 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -2847,20 +2847,20 @@ index_update_stats(Relation rel, * statistics, as the table statistics may be restored before the index is * created, and we want to preserve the restored table statistics. */ - if (AutoVacuumingActive()) + if (rel->rd_rel->relkind == RELKIND_RELATION || + rel->rd_rel->relkind == RELKIND_TOASTVALUE || + rel->rd_rel->relkind == RELKIND_MATVIEW) { - if (rel->rd_rel->relkind == RELKIND_RELATION || - rel->rd_rel->relkind == RELKIND_TOASTVALUE || - rel->rd_rel->relkind == RELKIND_MATVIEW) + if (AutoVacuumingActive()) { StdRdOptions *options = (StdRdOptions *) rel->rd_options; if (options != NULL && !options->autovacuum.enabled) update_stats = false; } + else + update_stats = false; } - else - update_stats = false; /* * Finish I/O and visibility map buffer locks before |