Re: [HACKERS] regressin failure on latest CVS

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rocco Altier <RoccoA(at)Routescape(dot)com>
Cc: Michael Glaesemann <grzm(at)myrealbox(dot)com>, pgsql-patches(at)postgresql(dot)org, ohp(at)pyrenet(dot)fr
Subject: Re: [HACKERS] regressin failure on latest CVS
Date: 2005-07-23 18:51:16
Message-ID: 200507231851.j6NIpGv15183@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Would you please try the attached patch and let me know if it fixes the
problem? I avoided accumulating into a float8.

---------------------------------------------------------------------------

Rocco Altier wrote:
> This still does not fix the problem.
>
> I had done my patch to try to mimic the way 8.0 had handled the math
> with the remainders, but to carry it over another bucket (day).
>
> The problem that I see is that we are taking day_remainder and
> multiplying by USECS_PER_DAY. Which is a double * int64, thus there is
> the precision loss there.
>
> I think initial division by the factor can't be helped, but repeatedly
> doing more floating point math on with it is causing the rounding error.
>
> Thanks,
> -rocco
>
> > -----Original Message-----
> > From: Bruce Momjian [mailto:pgman(at)candle(dot)pha(dot)pa(dot)us]
> > Sent: Saturday, July 23, 2005 10:54 AM
> > To: Rocco Altier
> > Cc: Michael Glaesemann; pgsql-patches(at)postgresql(dot)org;
> > pgsql-hackers(at)postgresql(dot)org; ohp(at)pyrenet(dot)fr
> > Subject: Re: [HACKERS] regressin failure on latest CVS
> >
> >
> > Rocco Altier wrote:
> > > This patch fixes the interval regression on my AIX box
> > (kookaburra) by
> > > only doing integer math on the interval, instead of
> > float/double math.
> > >
> > > I think this is the correct way to handle this, since it's
> > an integer
> > > data type.
> > >
> > > I don't know if it will fix Olivier's problem, since I
> > wasn't able to
> > > reproduce it.
> > >
> >
> > I have changed the way I compute the remainder values --- instead of
> > using multiplication, I use division and then subtraction.
> > This should
> > fix your rounding problem. Looking at your fix, I don't see
> > how adding
> > USECS changes things because the factor is already a float,
> > but I think
> > the problem was more the way I was computing the remainders.
> >
> > Patch attached --- let me know if it does not fix your problem.
> >
> > --------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 0 bytes
unknown_filename text/plain 1.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-07-23 19:01:10 Re: For review: Server instrumentation patch
Previous Message Robert Treat 2005-07-23 18:27:51 Re: [HACKERS] Enticing interns to PostgreSQL

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-07-23 19:01:10 Re: For review: Server instrumentation patch
Previous Message Bruce Momjian 2005-07-23 17:32:30 Re: [HACKERS] O_DIRECT for WAL writes