Re: When/if to Reindex - Mailing list pgsql-performance

From Gregory Stark
Subject Re: When/if to Reindex
Date
Msg-id 876434zogy.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: When/if to Reindex  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: When/if to Reindex
List pgsql-performance
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> "Steven Flatt" <steven.flatt@gmail.com> writes:
>> So, can we simply trust what's in pg_class.relpages and ignore looking
>> directly at the index?
>
> No, we can't.  In the light of morning I remember more about the reason
> for the aforesaid patch: it's actually unsafe to read the pg_class row
> at all if you have not got lock on the index.  We are reading with
> SnapshotNow in order to be sure we see up-to-date info, and that means
> that a concurrent update of the row (eg, for REINDEX to report the new
> relfilenode) can have the following behavior:

Should reindex be doing an in-place update? Don't we have to do in-place
updates for other system catalogs which are read in snapshotnow for precisely
the same reasons?

Alternatively, why does the planner need access to the pg_class entry and not
just the pg_index record?

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-performance by date:

Previous
From: Kevin Kempter
Date:
Subject: significant vacuum issues - looking for suggestions
Next
From: Bill Moran
Date:
Subject: Re: significant vacuum issues - looking for suggestions