Re: REINDEX slow? - Mailing list pgsql-general

From Greg Stark
Subject Re: REINDEX slow?
Date
Msg-id 87ekqseg4e.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: REINDEX slow?  (Edmund Dengler <edmundd@eSentire.com>)
List pgsql-general
Edmund Dengler <edmundd@eSentire.com> writes:

> Alternatively, if I created a second index, and then dropped the first,
> would this be faster (though I would suppose that an ANALYZE would need to
> be done to recognize the utility of the new index, thereby negating any
> speed improvements)?

Currently analyze doesn't check what indexes exist, it analyzes all the
columns of the table anyways. However I think this won't be true in 7.5 when
there are expression indexes, and there has been talk of changing this in
future to take into account indexes and foreign keys.

I don't think it would be any faster but it might avoid downtime. Reindex
seems to block any use of the index until the reindex completes, while doing
this two-step would avoid blocking queries. I haven't tried it myself though
so I'm not sure what gotchas might arise.

--
greg

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Data Encryption in PostgreSQL, and a Tutorial.
Next
From: Dennis Gearon
Date:
Subject: specifics about BIT(n) types