View Single Post

   
  #4 (permalink)  
Old 04-19-2008, 07:42 AM
Nolan Cafferky
 
Posts: n/a
Default Re: Cluster vs. non-cluster query planning

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.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Reply With Quote