Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B7C6D9FC0AF for ; Thu, 7 Jun 2007 19:58:36 -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 33927-09 for ; Thu, 7 Jun 2007 19:58:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id AA51B9FC091 for ; Thu, 7 Jun 2007 19:58:32 -0300 (ADT) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l57MwCnw007951; Thu, 7 Jun 2007 15:58:12 -0700 Message-ID: <46688DBA.7000800@commandprompt.com> Date: Thu, 07 Jun 2007 15:59:06 -0700 From: "Joshua D. Drake" User-Agent: Thunderbird 1.5.0.10 (X11/20070403) MIME-Version: 1.0 To: George Pavlov CC: Tom Lane , pgsql-general@postgresql.org Subject: Re: index vs. seq scan choice? References: <8C5B026B51B6854CBE88121DBF097A86C3A30D@ehost010-33.exch010.intermedia.net> <27828.1180055291@sss.pgh.pa.us> <8C5B026B51B6854CBE88121DBF097A86DEA6B4@ehost010-33.exch010.intermedia.net> <4668804F.6090201@commandprompt.com> <8C5B026B51B6854CBE88121DBF097A86DEA6C5@ehost010-33.exch010.intermedia.net> <415.1181255628@sss.pgh.pa.us> <8C5B026B51B6854CBE88121DBF097A86DEA6D3@ehost010-33.exch010.intermedia.net> In-Reply-To: <8C5B026B51B6854CBE88121DBF097A86DEA6D3@ehost010-33.exch010.intermedia.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 07 Jun 2007 15:58:13 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/551 X-Sequence-Number: 115374 George Pavlov wrote: >> From: Tom Lane >> "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. > > Thanks, Tom, I will try that. Seems better than fiddling with > enable_seqscan around every query/transaction. > > Joshua, I fail to understand why setting and unsetting enable_seqscan on > a per query/transaction basis is in any way preferable to query hints? > Don't get me wrong, I don't like the idea of hints, and I have read the > archives on the subject and I agree with the philosophy, but if the > optimization toolkit for routine application queries is going to include > setting config parameters that just smacks of hints by another name... I actually have zero opinion on hints, my comment was more about opening the wasps nest of the hints discussion more than anything :) Joshua D. Drake > > George > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/