From: | Alex Stapleton <alexs(at)advfn(dot)com> |
---|---|
To: | jbduffy(at)tiscali(dot)co(dot)uk |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Real vs Float & 32bit vs 64bit CPU Performance Question |
Date: | 2005-07-31 19:25:20 |
Message-ID: | 9410E79F-78C2-438D-9A0E-FB77ADF6D157@advfn.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Depending on how your version of PG was built, there will probably be
hardly any difference in speed as far as the CPU is concerned as the
FPU should be happy with both, and I think MMX/MMX2/SSE/SSE2/3dNow!
have some relevant optimisations for that sort of thing as well. You
will be transferring twice as much data around though, so you might
max out your memory bandwidth sooner than you would otherwise. I
think the general recommendation is to use doubles over floats in
most cases for everything days.
Of course if you do find that your performance sucks with doubles,
FLOATs are only are a "quick" ALTER TABLE away if you don't need the
precision.
On 27 Jul 2005, at 23:08, jbduffy(at)tiscali(dot)co(dot)uk wrote:
> Hi
>
> I am wrting a application that involves a lot of floating point
> number crunching.
> My data is stored in tables of the form:
>
> TABLE data (
> date_id INT,
> value FLOAT)
>
> I have just noticed in the documention that the FLOAT data type is
> stored
> in 8 bytes (ie 64 bits) as opposed to the REAL data type which uses
> 4 bytes
> (ie 32 bits).
>
> All things being equal, does this mean that if I change my data
> type to REAL
> (and lose some precision) I will see a significant performance
> increase on
> my 32 bit Pentium 4?
>
> Or, if I keep my data type as FLOAT will I see a significant
> performance
> increase by changing to a 64 bit CPU?
>
> Regards
>
> John Duffy
>
>
>
>
> ___________________________________________________________
>
> Book yourself something to look forward to in 2005.
> Cheap flights - http://www.tiscali.co.uk/travel/flights/
> Bargain holidays - http://www.tiscali.co.uk/travel/holidays/
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that
> your
> message can get through to the mailing list cleanly
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Mayer | 2005-07-31 20:41:10 | Re: GUID for postgreSQL |
Previous Message | Jeffrey Melloy | 2005-07-31 05:54:09 | Re: Tool for database design documentation? |