pgsql: CREATE INDEX: do update index stats if autovacuum=off.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: CREATE INDEX: do update index stats if autovacuum=off.
Date: 2025-03-10 21:49:52
Message-ID: E1trl0S-001pBV-21@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CREATE INDEX: do update index stats if autovacuum=off.

This fixes a thinko from commit d611f8b15. The intent was to prevent
updating the stats of the pre-existing heap if autovacuum is off,
but it also disabled updating the stats of the just-created index.
There is AFAICS no good reason to do the latter, since there could not
be any pre-existing stats to refrain from overwriting, and the zeroed
stats that are there to begin with are very unlikely to be useful.
Moreover, the change broke our cross-version upgrade tests again.

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/1116282.1741374848@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/29d6808edebb3eced76e2acbbcf453dd693ac6bf

Modified Files
--------------
src/backend/catalog/index.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2025-03-10 22:46:12 Re: pgsql: tests: Fix race condition in postmaster/002_connection_limits
Previous Message Heikki Linnakangas 2025-03-10 17:44:48 pgsql: Fix a few more redundant calls of GetLatestSnapshot()