Re: Temporarily very slow planning time after a big delete - Mailing list pgsql-performance

From Peter Geoghegan
Subject Re: Temporarily very slow planning time after a big delete
Date
Msg-id CAH2-Wz=cVFP2XUuJvMJJNPc0VdCOGWqrz-oiWqjqoaEntSYbGQ@mail.gmail.com
Whole thread Raw
In response to Re: Temporarily very slow planning time after a big delete  (Walter Smith <walter@carezone.com>)
List pgsql-performance
On Tue, May 21, 2019 at 11:27 AM Walter Smith <walter@carezone.com> wrote:
> Very low. Probably less than ten over all time. I suspect the only use of the index is to rapidly find the
processed=falserows, so the notifiable_type value isn’t important, really. It would probably work just as well on any
othercolumn. 

This problem has been fixed in Postgres 12, which treats heap TID as a
tiebreaker column within B-Tree indexes. It sounds like you have the
right idea about how to work around the problem.

VACUUM will need to kill tuples in random locations in the low
cardinality index, since the order of tuples is unspecified between
duplicate tuples -- it is more or less random. VACUUM will tend to
dirty far more pages than is truly necessary in this scenario, because
there is no natural temporal locality that concentrates dead tuples in
one or two particular places in the index. This has a far more
noticeable impact on VACUUM duration than you might expect, since
autovacuum is throttled by delays that vary according to how many
pages were dirtied (and other such factors).

--
Peter Geoghegan



pgsql-performance by date:

Previous
From: didier
Date:
Subject: Re: Temporarily very slow planning time after a big delete
Next
From: Lev Kokotov
Date:
Subject: Use Postgres as a column store by creating one table per column