Re: [HACKERS] Runtime Partition Pruning

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Beena Emerson <memissemerson(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>, amul sul <sulamul(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: [HACKERS] Runtime Partition Pruning
Date: 2018-01-04 23:58:24
Message-ID: CAKJS1f-7HrcvzDtEC8cCB-8FbmSWT-21AEzsXhvq0N-wzvAVvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 January 2018 at 05:37, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> I tried this patch (applying it on Amit's last current version on top of
> 4e2970f8807f which is the latest it applies to) and regression tests
> fail with the attached diff; in all cases it appears to be an off-by-one
> in row count. Would you please give it a look?

Looks like it's down to ExplainPropertyFloat() having
machine-dependent behaviour.

On the machine that I was working with when testing this the following
code outputs "1"

#include <stdio.h>

double nfiltered = 1.0;
double nloops = 2.0;

int main(void)
{
printf("%.*f", 0, nfiltered / nloops);
return 0;
}

but on your machine it must be outputting "0"?

I'm not sure if I should just try to have even row numbers in the
tests, or if we should be fixing EXPLAIN so it is consistent.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-01-05 00:54:35 Re: [HACKERS] Runtime Partition Pruning
Previous Message Jing Wang 2018-01-04 23:25:46 Re: Libpq support to connect to standby server as priority