pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #12675: BIGINT Datatype performance
2+ messages / 2 participants
[nested] [flat]
* BUG #12675: BIGINT Datatype performance
@ 2015-01-26 21:04 derek.anderson@mspmac.org
2015-01-27 11:38 ` Re: BUG #12675: BIGINT Datatype performance Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 1 reply; 2+ messages in thread
From: derek.anderson@mspmac.org @ 2015-01-26 21:04 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 12675
Logged by: Derek Anderson
Email address: derek.anderson@mspmac.org
PostgreSQL version: 9.4.0
Operating system: Linux
Description:
I did some testing on bigint vs double precision datatype performance for a
project we have going on here.
To my surprise, I found the double precision (floating) was well over 200%
faster than bigint in aggregate functions. I don't know if this qualifies
as a bug, but it sure seems odd considering non-floating type datatypes
usually perform much faster than floating.
Please contact me if you wish to discuss.
-Derek
Derek Anderson
612.293.8515
Metropolitan Airports Commission
derek.anderson@mspmac.org
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #12675: BIGINT Datatype performance
2015-01-26 21:04 BUG #12675: BIGINT Datatype performance derek.anderson@mspmac.org
@ 2015-01-27 11:38 ` Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 0 replies; 2+ messages in thread
From: Heikki Linnakangas @ 2015-01-27 11:38 UTC (permalink / raw)
To: derek.anderson@mspmac.org; pgsql-bugs
On 01/26/2015 11:04 PM, derek.anderson@mspmac.org wrote:
> The following bug has been logged on the website:
>
> Bug reference: 12675
> Logged by: Derek Anderson
> Email address: derek.anderson@mspmac.org
> PostgreSQL version: 9.4.0
> Operating system: Linux
> Description:
>
> I did some testing on bigint vs double precision datatype performance for a
> project we have going on here.
>
> To my surprise, I found the double precision (floating) was well over 200%
> faster than bigint in aggregate functions. I don't know if this qualifies
> as a bug, but it sure seems odd considering non-floating type datatypes
> usually perform much faster than floating.
>
> Please contact me if you wish to discuss.
The built-in aggregates on bigint, like sum and avg, use numeric
internally because the sum of bigints can easily be too large to fit in
a bigint. Their return type is also numeric for the same reason.
Arithmetic on numeric is much slower than on double.
There is a patch being discussed that would help with that, for 9.5. See
http://www.postgresql.org/message-id/544BB5F1.50709@proxel.se. With the
patch, the aggregates would use a 128-bit integer type for the internal
calculations, making them much faster.
- Heikki
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-01-27 11:38 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 21:04 BUG #12675: BIGINT Datatype performance derek.anderson@mspmac.org
2015-01-27 11:38 ` Heikki Linnakangas <hlinnakangas@vmware.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox