Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 3DD549FBECF for ; Wed, 11 Jul 2007 17:17:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 13636-03 for ; Wed, 11 Jul 2007 17:16:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id 593609FBE0F for ; Wed, 11 Jul 2007 17:17:03 -0300 (ADT) Received: from a-kretschmer.de (p54B39BDE.dip0.t-ipconnect.de [84.179.155.222]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id l6BKGtTe028020 for ; Wed, 11 Jul 2007 22:16:56 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.61) (envelope-from ) id 1I8ifG-0005Kk-OL for pgsql-performance@postgresql.org; Wed, 11 Jul 2007 22:19:58 +0200 Date: Wed, 11 Jul 2007 22:19:58 +0200 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: bitmap-index-scan slower than normal index scan Message-ID: <20070711201958.GA18449@KanotixBox> References: <20070711183638.GA30872@KanotixBox> <1331.1184184273@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1331.1184184273@sss.pgh.pa.us> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/121 X-Sequence-Number: 25805 Tom Lane schrieb: Thanks you and Alex for the response. > > PostgreSQL 8.1.4 on i386-pc-linux-gnu, compiled by GCC cc (GCC) 3.3.5 (Debian 1:3.3.5-13) > > You need a newer one. I know ;-) > > This is simply a stupid choice on the part of choose_bitmap_and() --- > it's adding on a second index to try to filter on maschine when that > scan will actually just increase the cost. > > I've revisited choose_bitmap_and() a couple times since then; try > 8.1.9 and see if it gets this right. Okay, but later. > > Also, part of the problem here looks to be an overestimate of the number > of rows matching ab = 347735. It might help to increase the statistics > target for that column. I will try this tomorrow and inform you about the result. I've never done this before, i need to read the docs about this. Thank you again. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°