Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id DEF749FBE9D for ; Fri, 8 Jun 2007 01:15:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 83923-02 for ; Fri, 8 Jun 2007 01:15:30 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id F0B179FB5F1 for ; Fri, 8 Jun 2007 01:15:30 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 6E8733094C; Fri, 8 Jun 2007 06:15:28 +0200 (MET DST) From: ptjm@interlog.com (Patrick TJ McPhee) X-Newsgroups: pgsql.general Subject: Re: index vs. seq scan choice? Date: Fri, 08 Jun 2007 04:13:54 -0000 Organization: Crampton Vinegar Works Message-ID: <136hls2op53c285@corp.supernews.com> References: <8C5B026B51B6854CBE88121DBF097A86C3A30D@ehost010-33.exch010.intermedia.net> <4668804F.6090201@commandprompt.com> <8C5B026B51B6854CBE88121DBF097A86DEA6C5@ehost010-33.exch010.intermedia.net> <415.1181255628@sss.pgh.pa.us> Originator: ptjm@interlog.com (Patrick TJ McPhee) X-Complaints-To: abuse@supernews.com Lines: 20 To: pgsql-general@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/593 X-Sequence-Number: 115416 In article <415.1181255628@sss.pgh.pa.us>, Tom Lane wrote: % "George Pavlov" writes: % >> From: Joshua D. Drake [mailto:jd@commandprompt.com] % >> In those rare cases wouldn't it make more sense to just set % >> enable_seqscan to off; run query; set enable_seqscan to on; % % > 1. these cases are not that rare (to me); % % It strikes me that you probably need to adjust the planner cost % parameters to reflect reality on your system. Usually dropping % random_page_cost is the way to bias the thing more in favor of % index scans. Also, increasing effective_cache_size. (And increasing statistics...) -- Patrick TJ McPhee North York Canada ptjm@interlog.com