Re: [NOVICE] Postgres storing time in strange manner - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [NOVICE] Postgres storing time in strange manner
Date
Msg-id 12219.1032302262@sss.pgh.pa.us
Whole thread Raw
In response to Re: [NOVICE] Postgres storing time in strange manner  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [NOVICE] Postgres storing time in strange manner
List pgsql-bugs
Bruce Momjian <pgman@candle.pha.pa.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...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [NOVICE] Postgres storing time in strange manner
Next
From: Bruce Momjian
Date:
Subject: Re: [NOVICE] Postgres storing time in strange manner