pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Florian Helmberger <fh@25th-floor.com>
Cc: pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@commandprompt.com>
Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
Date: Wed, 25 May 2011 19:11:31 -0400
Message-ID: <BANLkTinN6KrpcFDu-Ha0hCa6eN6hr4FYuA@mail.gmail.com> (raw)
In-Reply-To: <28141.1306360470@sss.pgh.pa.us>
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>
	<BANLkTim7YNLBBDUT9qXZrO2biuwDZ3kjyg@mail.gmail.com>
	<22926.1306343067@sss.pgh.pa.us>
	<BANLkTimVhdO_bKQagRsH0OLp7MxgJZDryg@mail.gmail.com>
	<28141.1306360470@sss.pgh.pa.us>

On Wed, May 25, 2011 at 5:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Wed, May 25, 2011 at 1:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Because the problem is not specific to TOAST tables.  As things
>>> currently stand, we will accept the word of an ANALYZE as gospel even if
>>> it scanned 1% of the table, and completely ignore the results from a
>>> VACUUM even if it scanned 99% of the table.  This is not sane.
>
>> I agree that if VACUUM scanned 99% of the table, it's probably fine to
>> use its numbers.  It's also fine to use the numbers from ANALYZE,
>> because those pages are chosen randomly.  What bothers me is the idea
>> of using a small *non-random* sample, and I'm not sure that
>> incorporating possibly-bogus results slowly is any better than
>> incorporating them quickly.
>
> The above is simply fuzzy thinking.  The fact that ANALYZE looked at a
> random subset of pages is *no guarantee whatsoever* that its results are
> highly accurate.  They might be more trustworthy than VACUUM's nonrandom
> sample of a similar number of pages, but it doesn't hold even a little
> bit of water to claim that we should believe ANALYZE completely and
> VACUUM not at all even when the latter has looked at a significantly
> larger sample of pages.

I think you're arguing against a straw-man.

> In any case, your line of thought doesn't help us for fixing the problem
> with toast tables, because we aren't going to start doing ANALYZEs on
> toast tables.

Can we simply use a constant for tuple density on TOAST tables?

> The bottom line here is that making use of stats we have is a lot better
> than not making use of them, even if they aren't entirely trustworthy.

http://dilbert.com/strips/comic/2008-05-07/

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



view thread (48+ messages)  latest in thread

Message-ID: <BANLkTinN6KrpcFDu-Ha0hCa6eN6hr4FYuA@mail.gmail.com>
Permalink:  ../BANLkTinN6KrpcFDu-Ha0hCa6eN6hr4FYuA@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTinN6KrpcFDu-Ha0hCa6eN6hr4FYuA@mail.gmail.com

 · 

reply

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-admin@postgresql.org
  Cc: robertmhaas@gmail.com, tgl@sss.pgh.pa.us, fh@25th-floor.com, alvherre@commandprompt.com
  Subject: Re: [ADMIN] pg_class reltuples/relpages not updated by autovacuum/vacuum
  In-Reply-To: <BANLkTinN6KrpcFDu-Ha0hCa6eN6hr4FYuA@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