Re: PostrgeSQL vs oracle doing 1 million sqrts am I doing it wrong? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: PostrgeSQL vs oracle doing 1 million sqrts am I doing it wrong?
Date
Msg-id CAFj8pRCbe+35gNygp3Gwvem21GRsJM9psxmaD2c0zZfD7MGSEA@mail.gmail.com
Whole thread Raw
In response to Re: PostrgeSQL vs oracle doing 1 million sqrts am I doing it wrong?  (James Cloos <cloos@jhcloos.com>)
List pgsql-hackers



2014-08-06 22:07 GMT+02:00 James Cloos <cloos@jhcloos.com>:
>>>>> "ST" == Shaun Thomas <sthomas@optionshouse.com> writes:

ST> That said, the documentation here says FLOAT4 is an alias for REAL,
ST> so it's somewhat nonintuitive for FLOAT4 to be so much slower than
ST> FLOAT8, which is an alias for DOUBLE PRECISION.

There are some versions of glibc where doing certain math on double is
faster than doing it on float, depending on how things are compiled.

Maybe this is one of them?

no

It is plpgsql issue only. PL/pgSQL uses a generic cast via serialization to string and new parsing

It doesn't use a effective libc casting functions.

see https://github.com/postgres/postgres/blob/master/src/pl/plpgsql/src/pl_exec.c function 
exec_cast_value
 

-JimC
--
James Cloos <cloos@jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: missing PG_RETURN_UINT16
Next
From: Heikki Linnakangas
Date:
Subject: Re: Index-only scans for GIST