From: Robert Haas <robertmhaas@gmail.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Florian Helmberger <fh@25th-floor.com>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Date: Thu, 26 May 2011 13:50:45 -0400
Message-ID: <BANLkTikTbZ8gibj+X++vkdqkxxJCU6trWw@mail.gmail.com> (raw)
In-Reply-To: <4DDE475B020000250003DD63@gw.wicourts.gov>
References: <4DD28F73.6010108@25th-floor.com>
<25017.1306291669@sss.pgh.pa.us>
<4DDCA801.70805@25th-floor.com>
<19738.1306338472@sss.pgh.pa.us>
<BANLkTi=973Arh-nXLO6YFP7_ZTCeNp-X7w@mail.gmail.com>
<22497.1306341699@sss.pgh.pa.us>
<BANLkTi=jcKSU5zR+JG2BvfLNCtezC9sb+g@mail.gmail.com>
<15043.1306423500@sss.pgh.pa.us>
<BANLkTikrCaoZCVrda6SNCUQFiYvvZX75BA@mail.gmail.com>
<25097.1306426982@sss.pgh.pa.us>
<BANLkTikxM6V5DUsXnDEs84z=oRMbyeoOgA@mail.gmail.com>
<4DDE475B020000250003DD63@gw.wicourts.gov>
On Thu, May 26, 2011 at 1:28 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Robert Haas <robertmhaas@gmail.com> wrote:
>> I think we should really consider replacing reltuples with
>> reltupledensity at some point. I continue to be afraid that using
>> a decaying average in this case is going to end up overweighting
>> the values from some portion of the table that's getting scanned
>> repeatedly, at the expense of other portions of the table that are
>> not getting scanned at all. Now, perhaps experience will prove
>> that's not a problem. But storing relpages and reltupledensity
>> separately would give us more flexibility, because we could feel
>> free to bump relpages even when we're not sure what to do about
>> reltupledensity. That would help Florian's problem quite a lot,
>> even if we did nothing else.
>
> Given how trivial it would be to adjust reltuples to keep its ratio
> to relpages about the same when we don't have a new "hard" number,
> but some evidence that we should fudge our previous value, I don't
> see where this change buys us much. It seems to mostly obfuscate
> the fact that we're changing our assumption about how many tuples we
> have. I would rather that we did that explicitly with code comments
> about why it's justified than to slip it in the way you suggest.
I'm a bit confused by this - what the current design obfuscates is the
fact that reltuples and relpages are not really independent columns;
you can't update one without updating the other, unless you want
screwy behavior. Replacing reltuples by reltupledensity would fix
that problem - it would be logical and non-damaging to update either
column independently.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: robertmhaas@gmail.com, Kevin.Grittner@wicourts.gov, tgl@sss.pgh.pa.us, fh@25th-floor.com, alvherre@commandprompt.com, gsstark@mit.edu, pgsql-hackers@postgresql.org
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
In-Reply-To: <BANLkTikTbZ8gibj+X++vkdqkxxJCU6trWw@mail.gmail.com>
References: <4DD28F73.6010108@25th-floor.com> <25017.1306291669@sss.pgh.pa.us> <4DDCA801.70805@25th-floor.com> <19738.1306338472@sss.pgh.pa.us> <BANLkTi=973Arh-nXLO6YFP7_ZTCeNp-X7w@mail.gmail.com> <22497.1306341699@sss.pgh.pa.us> <BANLkTi=jcKSU5zR+JG2BvfLNCtezC9sb+g@mail.gmail.com> <15043.1306423500@sss.pgh.pa.us> <BANLkTikrCaoZCVrda6SNCUQFiYvvZX75BA@mail.gmail.com> <25097.1306426982@sss.pgh.pa.us> <BANLkTikxM6V5DUsXnDEs84z=oRMbyeoOgA@mail.gmail.com> <4DDE475B020000250003DD63@gw.wicourts.gov> <BANLkTikTbZ8gibj+X++vkdqkxxJCU6trWw@mail.gmail.com>
* 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