X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0984B476317 for ; Mon, 12 May 2003 15:02:01 -0400 (EDT) Received: from flake.decibel.org (flake.decibel.org [66.143.173.58]) by postgresql.org (Postfix) with SMTP id 43FA447622E for ; Mon, 12 May 2003 15:01:59 -0400 (EDT) Received: (qmail 41651 invoked by uid 1001); 12 May 2003 19:01:56 -0000 Date: Mon, 12 May 2003 14:01:56 -0500 From: "Jim C. Nasby" To: pgsql-performance@postgresql.org Subject: How are null's stored? Message-ID: <20030512190156.GA40542@flake.decibel.org> Reply-To: jim@nasby.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net X-Spam-Status: No, hits=-12.7 required=5.0 tests=BAYES_10,SIGNATURE_SHORT_SPARSE,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/129 X-Sequence-Number: 1908 I have a 40M row table I need to import data into, then use to create a bunch of more normalized tables. Right now all fields are varchar, but I'm going to change this so that fields that are less than a certain size are just char. Question is, how much impact is there from char being nullable vs. not nullable? src/include/access/htup.h indicates that nulls are stored in a bitmap, so I'd suspect that I should see a decent space savings from not having to include length information all the time... (most of these small fields are always the same size no matter what...) -- Jim C. Nasby (aka Decibel!) jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"