PostgreSQL Server <postgres@rsd.it> writes:
> I found that the only way to force postgres to use index is:
> explain select id,datarx::date from docs where datarx between '2002-11-13' and '2002-11-14' ;
> Index Scan using idx_documenti_datarx on documenti (cost=0.00..7.86 rows=2 width=12)
Given the small cost estimates, you either are testing on a toy table,
or you have not run ANALYZE since loading up the table.
regards, tom lane