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 F12D43A41E0 for ; Wed, 24 Nov 2004 05:40:54 +0000 (GMT) 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 12061-03 for ; Wed, 24 Nov 2004 05:40:45 +0000 (GMT) Received: from web50002.mail.yahoo.com (web50002.mail.yahoo.com [206.190.38.17]) by svr1.postgresql.org (Postfix) with SMTP id 3599A3A4308 for ; Wed, 24 Nov 2004 05:40:44 +0000 (GMT) Received: (qmail 88467 invoked by uid 60001); 24 Nov 2004 05:40:43 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=uzGpLHEcw6FMyBwx98VzVHJUgVomYnQqU77sFQe04ZacybOY0WoTTC1uDYoVE/+QFLFOQWRTNQSwWgDPUI8S+fhzOyMLDTR21QaCvZZrjvymHe5aKYXXrIzRNFS3o53T30iUshAWnHeapCgxmrC4cpb61U0BzNaJpr1KWvjI8og= ; Message-ID: <20041124054043.88464.qmail@web50002.mail.yahoo.com> Received: from [200.93.192.137] by web50002.mail.yahoo.com via HTTP; Tue, 23 Nov 2004 23:40:43 CST Date: Tue, 23 Nov 2004 23:40:43 -0600 (CST) From: Jaime Casanova Subject: Re: Slow execution time when querying view with WHERE clause To: pgsql-performance@postgresql.org In-Reply-To: <41A3EC1F.6040706@mascari.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/361 X-Sequence-Number: 9315 --- Mike Mascari escribió: > Tom Lane wrote: > > Mike Mascari writes: > > > >>When I query the view with a simple filter, I get: > > > > > >>explain analyze select * from p_areas where > deactive is null; > > > > > > The problem seems to be here: > > > > > >> -> Seq Scan on _areas a (cost=0.00..2.48 > rows=1 width=163) (actual time=0.037..0.804 rows=48 > loops=1) > >> Filter: (deactive IS NULL) > > > > > > Why is it so completely off about the selectivity > of the IS NULL clause? null values are not indexable, is that your question? If it is your question then create a partial index with where deactive is null. regards, Jaime Casanova _________________________________________________________ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com