Re: [NOVICE] Postgres storing time in strange manner

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [NOVICE] Postgres storing time in strange manner
Date: 2002-09-17 22:42:19
Message-ID: 200209172242.g8HMgJx00385@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-novice

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> with -ffast-math gcc will "improve" it to
> >>
> >> int hour = time * 0.000277777777777778;
>
> > Hard to imagine why anyone would want such an optimization. How much
> > faster could it possibly be?
>
> Back in ye bad olde days, there was probably an order-of-magnitude
> difference between the speed of a float multiply and that of a float
> divide; so this used to be a pretty standard sort of optimization.
> I can remember doing the equivalent thing by hand in source code.
>
> On modern hardware I doubt it makes much difference...

And you would have to do a heck of a lot of them to see a difference.

--
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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2002-09-18 00:03:40 Re: [NOVICE] Postgres storing time in strange manner
Previous Message Tom Lane 2002-09-17 22:37:42 Re: [NOVICE] Postgres storing time in strange manner

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Chittenden 2002-09-18 08:07:30 Re: [NOVICE] Postgres storing time in strange manner
Previous Message Tom Lane 2002-09-17 22:37:42 Re: [NOVICE] Postgres storing time in strange manner