Skip site navigation (1) Skip section navigation (2)

Re: [NOVICE] Postgres storing time in strange manner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(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:37:42
Message-ID: 12219.1032302262@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-novice
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...

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Bruce MomjianDate: 2002-09-17 22:42:19
Subject: Re: [NOVICE] Postgres storing time in strange manner
Previous:From: Bruce MomjianDate: 2002-09-17 22:13:31
Subject: Re: [NOVICE] Postgres storing time in strange manner

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2002-09-17 22:42:19
Subject: Re: [NOVICE] Postgres storing time in strange manner
Previous:From: Bruce MomjianDate: 2002-09-17 22:13:31
Subject: Re: [NOVICE] Postgres storing time in strange manner

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group