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 3BF2DD9773 for ; Mon, 26 Sep 2005 19:04:09 -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 15609-01 for ; Mon, 26 Sep 2005 22:04:02 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0D818D97DF for ; Mon, 26 Sep 2005 19:04:03 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id B577331F51; Tue, 27 Sep 2005 00:04:05 +0200 (MET DST) From: Chris Browne X-Newsgroups: pgsql.performance Subject: Re: int2 vs int4 in Postgres Date: Mon, 26 Sep 2005 17:45:56 -0400 Organization: cbbrowne Computing Inc Lines: 22 Message-ID: <60br2flcyz.fsf@dba2.int.libertyrms.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, linux) Cancel-Lock: sha1:oTNygnAO+1MasDTtlfiXyV5XOew= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.094 required=5 tests=[AWL=0.094] X-Spam-Level: X-Archive-Number: 200509/361 X-Sequence-Number: 14669 truthhurts@insightbb.com ("Announce") writes: > I KNOW that I am not going to have anywhere near 32,000+ different > genres in my genre table so why use int4? Would that squeeze a few > more milliseconds of performance out of a LARGE song table query > with a genre lookup? If the field is immaterial in terms of the size of the table, then it won't help materially. If you were going to index on it, however, THAT would make it significant for indices involving the "genre" column. Fitting more tuples into each page is a big help, and this would help. I doubt it'll be material, but I'd think it a good thing to apply what restrictions to your data types that you can, a priori, so I'd be inclined to use "int2" for this... -- let name="cbbrowne" and tld="cbbrowne.com" in String.concat "@" [name;tld];; http://cbbrowne.com/info/nonrdbms.html Rules of the Evil Overlord #136. "If I build a bomb, I will simply remember which wire to cut if it has to be deactivated and make every wire red."