Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!! - Mailing list pgsql-admin

From Gaetano Mendola
Subject Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!
Date
Msg-id 016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2
Whole thread Raw
In response to cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!  ("Gaetano Mendola" <mendola@bigfoot.com>)
List pgsql-admin
From: "Tom Lane" <tgl@sss.pgh.pa.us>
> A saner way of tweaking the index-vs-seqscan costs is to reduce
> random_page_cost a little --- the default is 4.0 which may be on the
> high side.  (But don't push it below 1.0.)


So I tried:

# explain select * from to_del where col2 = 30;
NOTICE:  QUERY PLAN:

Seq Scan on to_del  (cost=0.00..8281.25 rows=4443 width=8)


for obtain an index scan I set random_page_cost = 2.8;
with 2.9 the choose was still the sequenzial scan.

# set random_page_cost = 2.8;
SET VARIABLE
#  explain select * from to_del where col2 = 30;
NOTICE:  QUERY PLAN:

Index Scan using idx_col2 on to_del  (cost=0.00..7953.95 rows=4443 width=8)

EXPLAIN


4.0 -> 2.8 is not so a little or not ?

Ciao
Gaetano


pgsql-admin by date:

Previous
From: Jarek Jarzebowski
Date:
Subject: Configuration tip.
Next
From: Paul Ramsey
Date:
Subject: Re: Multiple Postmasters on Beowulf cluster