From: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Gould <daveg@sonic.net>
Cc: pgsql-hackers@lists.postgresql.org, Alina Alexeeva <alexeeva@adobe.com>
Cc: Ullas Lakkur Raghavendra <lakkurra@adobe.com>
Subject: Re: [patch] BUG #15005: ANALYZE can make pg_class.reltuples inaccurate.
Date: Thu, 1 Mar 2018 19:56:20 +0300
Message-ID: <1386effe-0e6d-fd5a-6f0d-f294e4ef2dda@postgrespro.ru> (raw)
In-Reply-To: <18522.1519916974@sss.pgh.pa.us>
References: <20180117164916.3fdcf2e9@engels>
<fa8122c2-ea7a-ff38-49ac-e6616aec38ea@postgrespro.ru>
<20180228192337.67cc3f99@engels>
<4988c54a-1709-a978-9a43-65f8a1e09e94@postgrespro.ru>
<18522.1519916974@sss.pgh.pa.us>
On 01.03.2018 18:09, Tom Lane wrote:
> Ideally, at least, the estimate would remain on-target.
The test shows that under this particular scenario the estimated number
of tuples grows after each ANALYZE. I tried to explain how this happens
in the attached pdf. The direct averaging of the number of tuples, not
using the density, doesn't have this problem, so I suppose it could help.
> I think you're reinventing the way we used to do it. Perhaps consulting
> the git history in the vicinity of this code would be enlightening.
I see that before vac_estimate_reltuples was introduced, the results of
analyze and vacuum were used directly, without averaging. What I am
suggesting is to use a different way of averaging, not to remove it.
--
Alexander Kuzmenkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachments:
analyze.tex.pdf (application/pdf, 57.9K) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: a.kuzmenkov@postgrespro.ru, tgl@sss.pgh.pa.us, daveg@sonic.net, alexeeva@adobe.com, lakkurra@adobe.com
Subject: Re: [patch] BUG #15005: ANALYZE can make pg_class.reltuples inaccurate.
In-Reply-To: <1386effe-0e6d-fd5a-6f0d-f294e4ef2dda@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox