X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9543A11F6910 for ; Thu, 30 Mar 2006 01:18:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97703-04 for ; Thu, 30 Mar 2006 01:18:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by postgresql.org (Postfix) with ESMTP id 6226811F690C for ; Thu, 30 Mar 2006 01:18:18 -0400 (AST) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 9185111; Wed, 29 Mar 2006 21:21:15 -0800 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: Query using SeqScan instead of IndexScan Date: Wed, 29 Mar 2006 21:18:49 -0800 User-Agent: KMail/1.8.2 Cc: Brendan Duddridge References: <2F1712F1-E5E2-455E-A291-06F300A66549@clickspace.com> In-Reply-To: <2F1712F1-E5E2-455E-A291-06F300A66549@clickspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200603292118.50033.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.105 required=5 tests=[AWL=0.105] X-Spam-Score: 0.105 X-Spam-Level: X-Archive-Number: 200603/603 X-Sequence-Number: 18040 Brenden, > Any ideas what I can do to improve this without turning sequential =C2=A0 > scanning off? Hmmm, looks like your row estimates are good. Which means it's probably yo= ur=20 postgresql.conf parameters which are off. Try the following, in the order= =20 below: 1) Raise effective_cache_size to 2/3 of your RAM (remember that ecs is in 8= k=20 pages). Test again. 2) Multiply all of the cpu_* costs by 0.3. Test again. 3) Lower random_page_cost by steps to 3.5, then 3.0, then 2.5, then 2.0,=20 testing each time. These are all runtime-settable parameters, so you can test them in one quer= y=20 window, then set them in the main postgresql.conf if they work. =2D-=20 Josh Berkus Sun Microsystems San Francisco