Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group