X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0F8B3D1B504 for ; Sun, 28 Sep 2003 02:39:44 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 53586-02 for ; Sat, 27 Sep 2003 23:39:37 -0300 (ADT) Received: from web40408.mail.yahoo.com (web40408.mail.yahoo.com [66.218.78.105]) by svr1.postgresql.org (Postfix) with SMTP id 8587DD1B4EC for ; Sat, 27 Sep 2003 23:39:32 -0300 (ADT) Message-ID: <20030928023936.66818.qmail@web40408.mail.yahoo.com> Received: from [66.185.84.75] by web40408.mail.yahoo.com via HTTP; Sat, 27 Sep 2003 19:39:36 PDT Date: Sat, 27 Sep 2003 19:39:36 -0700 (PDT) From: "Yusuf W." Subject: Re: Performance: BigInt vs Decimal(19,0) To: pgsql-performance@postgresql.org In-Reply-To: <2125.1064708769@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/343 X-Sequence-Number: 3709 Now, I've got to convince my project's software architech, that a bigint would be better than a decimal. Does anyone know where I could get some documentation on how the int and decimal are implemented so I could prove to him that ints are better? Can people suggest good points to make in order to prove it? Thanks in advance. --- Tom Lane wrote: > "Yusuf W." 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 __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com