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