Re: Preliminary patch for on-the-fly relpages/reltuples estimation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Preliminary patch for on-the-fly relpages/reltuples estimation
Date: 2004-12-06 15:13:39
Message-ID: 1368.1102346019@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Markus Bertheau <twanger(at)bluetwanger(dot)de> writes:
>> + num_tuples = ceil(num_tuples + tuples_removed * 0.5);

> Not understanding a thing about the PG source code, and judging from the
> variable names, wouldn't you want ceil(num_tuples + (num_tuples -
> tuples_removed) * 0.5) instead?

No. num_tuples is post-removal. The full expression is
(num_tuples + (num_tuples + tuples_removed)) / 2
which simplifies as above.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Korea PostgreSQL Users' Group 2004-12-06 16:18:41 Re: patch contrib/pgcrypto for win32 (2) - bug report
Previous Message laurie.burrow 2004-12-06 13:25:09 Reverse engineering problem on views