pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yusuf W. <unicef2k@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance: BigInt vs Decimal(19,0)
Date: Sat, 27 Sep 2003 20:26:09 -0400
Message-ID: <2125.1064708769@sss.pgh.pa.us> (raw)
In-Reply-To: <20030927235414.54467.qmail@web40405.mail.yahoo.com>
References: <20030927235414.54467.qmail@web40405.mail.yahoo.com>

"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



view thread (7+ messages)  latest in thread

Message-ID: <2125.1064708769@sss.pgh.pa.us>
Permalink:  ../2125.1064708769@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2125.1064708769@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, unicef2k@yahoo.com
  Subject: Re: Performance: BigInt vs Decimal(19,0)
  In-Reply-To: <2125.1064708769@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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