X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E23DD97C4 for ; Mon, 26 Sep 2005 16:40:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76253-09 for ; Mon, 26 Sep 2005 19:40:22 +0000 (GMT) Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by svr1.postgresql.org (Postfix) with ESMTP id 27DD6D9778 for ; Mon, 26 Sep 2005 16:40:19 -0300 (ADT) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id 374F623948B; Mon, 26 Sep 2005 15:40:21 -0400 (EDT) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 34380-01-7; Mon, 26 Sep 2005 15:40:16 -0400 (EDT) Received: from [192.168.1.104] (d226-86-55.home.cgocable.net [24.226.86.55]) by mailbox.samurai.com (Postfix) with ESMTP id 800BD239473; Mon, 26 Sep 2005 15:40:15 -0400 (EDT) Subject: Re: int2 vs int4 in Postgres From: Neil Conway To: Announce Cc: pgsql-performance@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Mon, 26 Sep 2005 15:48:30 -0400 Message-Id: <1127764110.27799.2.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.0 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/359 X-Sequence-Number: 14667 On Mon, 2005-26-09 at 12:54 -0500, Announce wrote: > Is there an performance benefit to using int2 (instead of int4) in cases > where i know i will be well within its numeric range? int2 uses slightly less storage space (2 bytes rather than 4). Depending on alignment and padding requirements, as well as the other columns in the table, that may translate into requiring fewer disk pages and therefore slightly better performance and lower storage requirements. -Neil