Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9E10A9FB9A8 for ; Thu, 7 Jun 2007 19:29:14 -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 28713-03 for ; Thu, 7 Jun 2007 19:29:04 -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 E90829FB82F for ; Thu, 7 Jun 2007 19:29:10 -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 l57MSomB006827; Thu, 7 Jun 2007 15:28:50 -0700 Message-ID: <466886D8.2070901@commandprompt.com> Date: Thu, 07 Jun 2007 15:29:44 -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> In-Reply-To: <8C5B026B51B6854CBE88121DBF097A86DEA6C5@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:28:50 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/546 X-Sequence-Number: 115369 George Pavlov wrote: >> 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); I find that surprising. > > 2. setting enable_seqscan (in JDBC, say) from the application makes the > whole thing quite a mess (need to do a batch of statements: each query > wrapped in its enable/disable seq scan?) -- ideally, one would like to > issue mostly SQL statements, not config parameters from the application; Uh no. You do it at the beginning of the transaction, run your queries then reset it right before (or after) commit. > > 3. if this is the recommended suggestion on how to run queries then why > don't we just add HINTS to the system and be done with it... I suggest you read the archives, twice, before suggesting hints. > > > > -- === 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/