X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EBCBC52800 for ; Tue, 31 May 2005 02:59:44 -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 97998-09 for ; Tue, 31 May 2005 05:59:40 +0000 (GMT) Received: from exobox.exoweb.net (unknown [221.122.43.98]) by svr1.postgresql.org (Postfix) with SMTP id 3CB1852843 for ; Tue, 31 May 2005 02:59:33 -0300 (ADT) Received: (qmail 19218 invoked from network); 31 May 2005 05:59:32 -0000 Received: from exo185.exoweb.net (HELO tobias.nordicbet.invalid) (192.168.0.185) by 0 with SMTP; 31 May 2005 05:59:32 -0000 Received: by tobias.nordicbet.invalid (Postfix, from userid 500) id 25816E09C7; Tue, 31 May 2005 13:59:32 +0800 (CST) Date: Tue, 31 May 2005 13:59:32 +0800 From: Tobias Brox To: Tom Lane Cc: Bruno Wolff III , Tobias Brox , pgsql-performance@postgresql.org Subject: Re: Index on a NULL-value Message-ID: <20050531055932.GL26100@tobias.exoweb.net> References: <20050531030207.GD26100@tobias.exoweb.net> <20050531032119.GH26100@tobias.exoweb.net> <20050531033633.GA20015@wolff.to> <7923.1117513113@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7923.1117513113@sss.pgh.pa.us> Organization: Group Nordicbet User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/464 X-Sequence-Number: 12628 > CREATE INDEX b_is_null ON mock(a) WHERE b IS NULL; > > where a is chosen as a column that you frequently also test in > conjunction with "b IS NULL". That is, the above index can efficiently > handle queries like > > ... WHERE a = 42 AND b IS NULL ... This is wonderful, it seems like most of our problems (probably also regarding the "index on timestamp"-thread I started separately) can be solved with partial indexing on expressions. No need to hide under bedclothes anymore ;-) -- Tobias Brox, Beijing