Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 45514632898 for ; Thu, 2 Sep 2010 19:09:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52057-09 for ; Thu, 2 Sep 2010 22:09:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from glacier.frostconsultingllc.com (glacier.frostconsultingllc.com [69.36.227.170]) by mail.postgresql.org (Postfix) with ESMTP id 2EFCE63241D for ; Thu, 2 Sep 2010 19:09:21 -0300 (ADT) Received: from dsl081-245-111.sfo1.dsl.speakeasy.net ([64.81.245.111] helo=Sidney-Stratton.local) by glacier.frostconsultingllc.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.69) (envelope-from ) id 1OrHy7-00037c-Kk for pgsql-docs@postgreSQL.org; Thu, 02 Sep 2010 15:09:18 -0700 Message-ID: <4C80208B.4060908@agliodbs.com> Date: Thu, 02 Sep 2010 15:09:15 -0700 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: pgsql-docs@postgreSQL.org Subject: Correction: datatypes are not "faster" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201009/28 X-Sequence-Number: 6018 All, This is currently in: http://www.postgresql.org/docs/current/interactive/datatype-numeric.html#DATATYPE-INT "The type integer is the common choice, as it offers the best balance between range, storage size, and performance. The smallint type is generally only used if disk space is at a premium. The bigint type should only be used if the integer range is insufficient, because the latter is definitely faster." This paragraph leaves a *lot* to be desired from an accuracy perspective and encourages useless byte-counting by amateur performance geeks. Instead: The integer type is the most common choice, as it covers a sufficient range for most operations requiring a non-decimal numeric value. If, however, you think you will want to store numbers greater than 2.4 billion, then use bigint. Note that bigint will require more storage space and memory. When you have several integer columns in the same table with values less than 32,000, you can sometimes achieve significant space savings by using smallint instead of integer. Otherwise, using smallint usually results in no real space or memory savings. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com