marcelo Cortez <jmdc_marcelo@yahoo.com.ar> writes:
> I am confused ,
> way planer it does not use the partial index?
> query:
> SELECT cliente_base.* FROM cliente_base
> WHERE (cliente_base.inst_class_ = 'Cliente' ) ORDER
> BY cliente_base.nombre ASC
Because it thinks the seqscan is cheaper. It might be right, depending
on how selective the index predicate is and how close the index order
matches the physical heap order. Have you tried forcing an indexscan
(eg, by setting enable_sort = off) and comparing estimated and actual
costs for that case?
regards, tom lane