Re: Stopgap solution for table-size-estimate updating

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zeugswetter Andreas DAZ SD <ZeugswetterA(at)spardat(dot)at>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Stopgap solution for table-size-estimate updating
Date: 2004-11-29 00:03:19
Message-ID: 1101686599.2963.105.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2004-11-28 at 22:35, Tom Lane wrote:
> Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > Given we expect an underestimate, can we put in a correction factor
> > should the estimate get really low...sounds like we could end up
> > choosing nested joins more often when we should have chosen merge joins.
>
> One possibility: vacuum already knows how many tuples it removed. We
> could set reltuples equal to, say, the mean of the number-of-tuples-
> after-vacuuming and the number-of-tuples-before. In a steady state
> situation this would represent a fairly reasonable choice. In cases
> where the table size has actually decreased permanently, it'd take a few
> cycles of vacuuming before reltuples converges to the new value, but that
> doesn't seem too bad.

That sounds good to me. Covers all cases I can see from here.

> A standalone ANALYZE should still do what it does now, though, I think;
> namely set reltuples to its best estimate of the current value.

A GUC-free solution...but yet manual control is possible. Sounds good to
me - and for you Andreas, also?

--
Best Regards, Simon Riggs

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Garamond 2004-11-29 00:22:18 Re: Status of server side Large Object support?
Previous Message Tom Lane 2004-11-28 23:58:16 Re: Adding Reply-To: <listname> to Lists configuration ...