Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9D5D59F925C for ; Tue, 30 Oct 2007 13:14:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 57639-01-3 for ; Tue, 30 Oct 2007 13:14:35 -0300 (ADT) X-Greylist: delayed 00:59:59.177464 by SQLgrey-1.7.5 Received: from globalrelay.com (mail1.globalrelay.com [204.92.49.200]) by postgresql.org (Postfix) with ESMTP id DE60B9F9B26 for ; Tue, 30 Oct 2007 13:13:23 -0300 (ADT) X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway Received: from [63.231.179.95] (HELO davedell) by globalrelay.com (CommuniGate Pro SMTP 4.2.3) with ESMTP id 162539928; Tue, 30 Oct 2007 15:13:23 +0000 From: "Dave Dutcher" To: "'Christian Rengstl'" , References: <4727402E.90AD.0080.0@klinik.uni-regensburg.de> Subject: Re: Optimizing PostgreSQL for Windows Date: Tue, 30 Oct 2007 10:13:15 -0500 Message-ID: <015601c81b07$657cae10$8e00a8c0@tridecap.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4727402E.90AD.0080.0@klinik.uni-regensburg.de> thread-index: Acga+R3ZdU/NFKiZT6a4ZDn8WWeXewADRE5g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/362 X-Sequence-Number: 27384 >From: Christian Rengstl >Subject: [PERFORM] Optimizing PostgreSQL for Windows > >Hi list, > >I have the following query: >select t.a1, t.a2 from table1 t inner join table2 s >using(id) where t.pid='xyz' and s.chromosome=9 order by s.pos; > >" -> Bitmap Heap Scan on table1 t (cost=388.25..27357.57 >rows=22286 width=23) (actual time=112.595..32989.663 rows=22864 loops=1)" >" Recheck Cond: ((pid)::text = 'xyz'::text)" >" -> Bitmap Index Scan on idx_table1 (cost=0.00..382.67 >rows=22286 width=0) (actual time=103.790..103.790 rows=22864 loops=1)" >" Index Cond: ((pid)::text = 'xyz'::text)" The bitmap heap scan on table1 seems very slow. What version of Postgres are you using? There were performance enhancements in 8.1 and 8.2. What kind of a hard drive are you using? I would guess a single SATA drive would give you better performance than that, but I don't know for sure. Do you regularly vacuum the table? Not enough vacuuming can lead to tables filled with dead rows, which can increase the amount of data needing to be scanned considerably. Dave