Re: clamp_row_est avoid infinite

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: clamp_row_est avoid infinite
Date: 2024-04-23 03:54:27
Message-ID: 3228866.1713844467@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> if (nrows > MAXIMUM_ROWCOUNT || isnan(nrows))
> nrows = MAXIMUM_ROWCOUNT;
> else if (nrows <= 1.0)
> nrows = 1.0;
> else
> nrows = rint(nrows);

> The comments say `Avoid infinite and NaN`
> but actually we only avoid NaN.

Really? The IEEE float arithmetic standard says that Inf is
greater than any finite value, and in particular it'd be
greater than MAXIMUM_ROWCOUNT.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Imseih (AWS), Sami 2024-04-23 04:16:29 Re: query_id, pg_stat_activity, extended query protocol
Previous Message Tom Lane 2024-04-23 03:52:21 Re: Statistics Import and Export