Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B661E9FBAB1 for ; Fri, 20 Apr 2007 09:21:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 34380-06-2 for ; Fri, 20 Apr 2007 09:20:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by postgresql.org (Postfix) with ESMTP id 19FC79FBAD0 for ; Fri, 20 Apr 2007 09:20:24 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1Hes652mo4-0000Zz; Fri, 20 Apr 2007 14:20:18 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1Hes64-0007PR-00 for pgsql-sql@postgresql.org; Fri, 20 Apr 2007 14:20:16 +0200 Date: Fri, 20 Apr 2007 14:20:16 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: many 'OR' in WHERE-condition Message-ID: <20070420122016.GF15322@a-kretschmer.de> References: <20070420051341.GA15322@a-kretschmer.de> <46289E10.9060302@archonet.com> <20070420112930.GE15322@a-kretschmer.de> <4628AB05.6000400@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4628AB05.6000400@archonet.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX19gPhU+tKYtkJFRTXRuK8FScjUm5XPAaitgW0n 90mc9D8HJxQAZTnH23RmuQT815tLG+M0YHq81wim2gLKoYk1Nj sJ1oHogSql8TOQg3wvGzC3SxV2MhoW4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/178 X-Sequence-Number: 28178 am Fri, dem 20.04.2007, um 12:59:01 +0100 mailte Richard Huxton folgendes: > A. Kretschmer wrote: > > > >It's not my problem - i found it in a forum (german) > >http://pg-forum.de/showthread.php?t=1332 > > > >If the list contains up to 195 entrys -> up to 195 bitmap index scans > >and BitmapOr -> 7.839ms > > > >If the list contains 196 entrys -> seq-scan -> 5591.567ms > > It looks like it's getting the row estimate badly wrong. > > "Seq Scan on t_datasets_searchindices_rel (cost=0.00..129053.50 > rows=159277 width=4) (actual time=0.213..5590.435 rows=325 loops=1) Uh oh, i have overlook this. > > Probably worth increasing the statistics estimate for that column (ALTER > TABLE ... ALTER COLUMN ... SET STATISTICS=N) Thx for your hints! Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net