reindex database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

reindex database

PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/sql-reindex.html
Description:

Hello,
I am using this command to reindex the databases for a PostgreSQL 10
cluster.
What I can not find in the reindex explanation page is how is this affecting
the standby database. I tracked the log creation on the Primary cluster but
I saw nothing like this on the Standby cluster.
I was able to find the following statement on the hot-standby description
page (26.5. Hot Standby) from the documentation:
"As a result, you cannot create additional indexes that exist solely on the
standby, nor statistics that exist solely on the standby. If these
administration commands are needed, they should be executed on the primary,
and eventually those changes will propagate to the standby."
(https://www.postgresql.org/docs/10/hot-standby.html)
Can you please tell me more on this topic or point me to the documentation
page that explained more on this topic (database reindex - synching with the
standby cluster and impact on the standby cluster).
Thank you,
Andrei Bancila
Reply | Threaded
Open this post in threaded view
|

Re: reindex database

Bruce Momjian
On Sun, Jun 28, 2020 at 08:42:10PM +0000, PG Doc comments form wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/10/sql-reindex.html
> Description:
>
> Hello,
> I am using this command to reindex the databases for a PostgreSQL 10
> cluster.
> What I can not find in the reindex explanation page is how is this affecting
> the standby database. I tracked the log creation on the Primary cluster but
> I saw nothing like this on the Standby cluster.
> I was able to find the following statement on the hot-standby description
> page (26.5. Hot Standby) from the documentation:
> "As a result, you cannot create additional indexes that exist solely on the
> standby, nor statistics that exist solely on the standby. If these
> administration commands are needed, they should be executed on the primary,
> and eventually those changes will propagate to the standby."
> (https://www.postgresql.org/docs/10/hot-standby.html)
> Can you please tell me more on this topic or point me to the documentation
> page that explained more on this topic (database reindex - synching with the
> standby cluster and impact on the standby cluster).
> Thank you,
> Andrei Bancila

For full-cluster, non-logical replication, the data files on the primary
and replicas have to be identical, so any reindex on the primary
generates replayed WAL records to the replica to recreate the index.

--
  Bruce Momjian  <[hidden email]>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee