X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7F1E39DC81E for ; Tue, 17 Jan 2006 11:20:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64482-10 for ; Tue, 17 Jan 2006 11:20:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DE8979DC94A for ; Tue, 17 Jan 2006 11:20:45 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0HFKo1s028459; Tue, 17 Jan 2006 10:20:50 -0500 (EST) To: Diego cc: pgsql-admin@postgresql.org Subject: Re: Creste Index with nullable In-reply-to: <43CCECE2.5030300@unimedijui.com.br> References: <43CCECE2.5030300@unimedijui.com.br> Comments: In-reply-to Diego message dated "Tue, 17 Jan 2006 10:10:58 -0300" Date: Tue, 17 Jan 2006 10:20:50 -0500 Message-ID: <28458.1137511250@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.09 required=5 tests=[AWL=0.090] X-Spam-Score: 0.09 X-Spam-Level: X-Archive-Number: 200601/184 X-Sequence-Number: 20272 Diego writes: > I can create a index like > "CREATE INDEX idx_test ON etqmov USING btree (name, last_name)" > using a nullable field? Will work fine? Sure. Note however that "last_name IS NULL" is not an indexable operation, so you won't be able to use the index to search for rows containing nulls. This may or may not matter to you, but if it does you'll need to think of another way to locate those rows. (Some people solve this sort of problem with partial indexes.) regards, tom lane