Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 2FFC89FC1D4 for ; Thu, 7 Jun 2007 19:35:20 -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 96904-01-4 for ; Thu, 7 Jun 2007 19:35:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 534609FC264 for ; Thu, 7 Jun 2007 19:35:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l57MXmB3000416; Thu, 7 Jun 2007 18:33:48 -0400 (EDT) To: "George Pavlov" cc: "Joshua D. Drake" , pgsql-general@postgresql.org Subject: Re: index vs. seq scan choice? In-reply-to: <8C5B026B51B6854CBE88121DBF097A86DEA6C5@ehost010-33.exch010.intermedia.net> 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> Comments: In-reply-to "George Pavlov" message dated "Thu, 07 Jun 2007 15:21:14 -0700" Date: Thu, 07 Jun 2007 18:33:48 -0400 Message-ID: <415.1181255628@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/548 X-Sequence-Number: 115371 "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. regards, tom lane