Re: index bloat estimation

From: Victor Sudakov <vas(at)sibptus(dot)ru>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: index bloat estimation
Date: 2021-02-17 02:27:24
Message-ID: YCx/DJkZRw0mzRyr@admin.sibptus.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Keith Fiske wrote:

[dd]
>
> You cannot run the actual scan on the replica, no. But it can be set to run
> against the replica and just report the statistics so you can have a cron
> set up to always run on the given system in case of failover. The
> "--recovery_mode_norun" can be set so it will only run if the target system
> is actually a primary.
>
> I could possibly see about letting this actually run against the replica,
> however this can be a rather long running transaction depending on the size
> of the tables involved. You can set the "--commit_rate" to avoid some of
> that, but if you have really large tables, it can still run quite long. So
> this sort of check is really best run against the primary to avoid issues
> around having to allow long running queries on the replica (delayed
> replication or even worse bloat buildup).

If you have a dedicated replica for OLAP, even one running from a WAL
archive (not from a replication slot), this is not an issue.

So running pg_bloat_check against a replica would be very useful for
some of us.

--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49(at)fidonet http://vas.tomsk.ru/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Keith Fiske 2021-02-17 15:12:38 Re: index bloat estimation
Previous Message Keith Fiske 2021-02-17 00:06:39 Re: index bloat estimation