Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9193D633431 for ; Sun, 10 Jan 2010 11:54:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 73088-08 for ; Sun, 10 Jan 2010 15:53:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id E57DA633098 for ; Sun, 10 Jan 2010 11:53:58 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Sun, 10 Jan 2010 09:53:56 -0600 Message-Id: <4B49A3AF020000250002E138@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Sun, 10 Jan 2010 09:53:51 -0600 From: "Kevin Grittner" To: Cc: Subject: Re: Choice of bitmap scan over index scan Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.589 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/178 X-Sequence-Number: 37058 Mathieu De Zutter wrote: > Intel(R) Core(TM)2 Duo CPU E7200 @ 2.53GHz > 2GB RAM > 2x500GB RAID-1 > Running Debian/Etch AMD64 > PG version: PostgreSQL 8.3.8 on x86_64 > Server also runs DNS/Mail/Web/VCS/... for budget reasons. > Database size is 1-2 GB. Also running copies of it for testing/dev. I would try something like this and see how it goes: shared_buffers = 200MB work_mem = 32MB effective_cache_size = 1.2GB seq_page_cost = 0.1 random_page_cost = 0.1 Some of these settings require a PostgreSQL restart. I may have gone too aggressively low on the page costs, but it seems likely with a "1-2 GB" database and 2 GB RAM, the active portions of your database will be fully cached in spite of the other applications. Besides looking at the impact on this one query, you should keep an eye on all queries after such changes, and post for any which become unacceptably slow. Properly tuning something like this can take a few iterations. -Kevin