Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D2D7C9FC07E for ; Thu, 7 Jun 2007 19:52:23 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60955-04 for ; Thu, 7 Jun 2007 19:52:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mis010.exch010.intermedia.net (mis010.exch010.intermedia.net [64.78.61.97]) by postgresql.org (Postfix) with ESMTP id 5F3D99FB75F for ; Thu, 7 Jun 2007 19:52:18 -0300 (ADT) Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by mis010.exch010.intermedia.net with Microsoft SMTPSVC(6.0.3790.1830); Thu, 7 Jun 2007 15:47:48 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: index vs. seq scan choice? Date: Thu, 7 Jun 2007 15:52:16 -0700 Message-ID: <8C5B026B51B6854CBE88121DBF097A86DEA6D3@ehost010-33.exch010.intermedia.net> In-Reply-To: <415.1181255628@sss.pgh.pa.us> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [GENERAL] index vs. seq scan choice? Thread-Index: AcepVA8eDuRDOS1oRqO0qeupEXUy5AAATr5g 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> From: "George Pavlov" To: "Tom Lane" , "Joshua D. Drake" , X-OriginalArrivalTime: 07 Jun 2007 22:47:48.0214 (UTC) FILETIME=[DF026960:01C7A955] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/550 X-Sequence-Number: 115373 > 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; >=20 > > 1. these cases are not that rare (to me); >=20 > 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... George