X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3962D9FA261 for ; Mon, 1 May 2006 18:08:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 77783-08 for ; Mon, 1 May 2006 18:08:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.89glass.com (mail.89glass.com [72.10.2.250]) by postgresql.org (Postfix) with SMTP id 7CF549FA2C5 for ; Mon, 1 May 2006 18:08:04 -0300 (ADT) Received: (qmail 2109 invoked by uid 1006); 1 May 2006 21:08:02 -0000 Received: from 192.168.254.111 by lumberjack (envelope-from , uid 201) with qmail-scanner-1.25 (clamdscan: 0.67. Clear:RC:1(192.168.254.111):. Processed in 0.028679 secs); 01 May 2006 21:08:02 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=domkey; d=rbsinteractive.com; b=UWZTv0AZQzdZQmryqTFgldh3HsF9+bukz21efKc6Bekj0ZQTWXkhcoaMPucpS5DV4F2N0WTaueKETmvUAg4dKb+4sNYsCzCK5v2fOTefnll89bjDuLJUAVpYoSLE49pD1iZYJHO3x+9oLp/iCXVZ9vH554J1ZODkvQ5a15bynFQ= ; Received: from unknown (HELO ?192.168.254.111?) (192.168.254.111) by mail.89glass.com with SMTP; 1 May 2006 21:08:02 -0000 Message-ID: <445678B1.9050908@rbsinteractive.com> Date: Mon, 01 May 2006 14:08:01 -0700 From: Nolan Cafferky User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Cluster vs. non-cluster query planning References: <445644F9.2020708@rbsinteractive.com> <44566612.8020709@rbsinteractive.com> <8044.1146515444@sss.pgh.pa.us> In-Reply-To: <8044.1146515444@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/21 X-Sequence-Number: 18808 Tom Lane wrote: >The first-order knob for tuning indexscan vs seqscan costing is >random_page_cost. What have you got that set to? > > This is currently at the default of 4. All of my other planner cost constants are at default values as well. Dropping it to 1 drops the estimated cost by a comparable ratio: Index Scan using orders_status_btree_idx on orders o (cost=1.20..3393.20 rows=7026 width=8) (actual time=0.050..0.314 rows=105 loops=1) Index Cond: (order_statuses_id = $0) InitPlan -> Seq Scan on order_statuses (cost=0.00..1.20 rows=1 width=4) (actual time=0.017..0.025 rows=1 loops=1) Filter: ((id_name)::text = 'new'::text) Total runtime: 0.498 ms But, I'm guessing that random_page_cost = 1 is not a realistic value.