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

From Mark Kirkwood
Subject Re: When/if to Reindex
Date
Msg-id 46CE6883.10104@paradise.net.nz
Whole thread Raw
In response to Re: When/if to Reindex  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: When/if to Reindex  ("Steven Flatt" <steven.flatt@gmail.com>)
List pgsql-performance
Tom Lane wrote:
>
> The fly in the ointment is that after collecting the pg_index definition
> of the index, plancat.c also wants to know how big it is --- it calls
> RelationGetNumberOfBlocks.  And that absolutely does look at the
> physical storage, which means it absolutely is unsafe to do in parallel
> with a REINDEX that will be dropping the old physical storage at some
> point.
>
> So maybe we are stuck and we have to say "that doesn't work anymore".
> But it feels like we might not be too far away from letting it still
> work.  Thoughts, ideas?
>

A suggestion that seems a bit like a leap backwards in time - maybe just
use the pg_class.relpages entry for the index size?

I'm punting that with autovacuum being enabled by default now, the
relpages entries for all relations will be more representative than they
used to in previous releases.

Cheers

Mark


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: When/if to Reindex
Next
From: Gregory Stark
Date:
Subject: Re: When/if to Reindex