Re: Performance: BigInt vs Decimal(19,0) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance: BigInt vs Decimal(19,0)
Date
Msg-id 2125.1064708769@sss.pgh.pa.us
Whole thread Raw
In response to Performance: BigInt vs Decimal(19,0)  ("Yusuf W." <unicef2k@yahoo.com>)
Responses Re: Performance: BigInt vs Decimal(19,0)
List pgsql-performance
"Yusuf W." <unicef2k@yahoo.com> writes:
> For the application that I'm working on, we want to
> use data types that are database independent.  (most
> databases has decimal, but not big int).

Most databases have bigint, I think.

> Anyhow, we are planning on using decimal(19,0) for our
> primary keys instead of a big int, would there be a
> performance difference in using a bigint over using decimals?

You'll be taking a very large performance hit, for very little benefit
that I can see.  How hard could it be to change the column declarations
if you ever move to a database without bigint?  There's not normally
much need for apps to be explicitly aware of the column type names.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Yusuf W."
Date:
Subject: Performance: BigInt vs Decimal(19,0)
Next
From: "Yusuf W."
Date:
Subject: Re: Performance: BigInt vs Decimal(19,0)