Re: help with query...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: help with query...
Date: 2007-05-28 21:53:08
Message-ID: 10955.1180389188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-05-28 22:04:37 Re: Possible DB corruption
Previous Message Tom Lane 2007-05-28 21:44:17 Re: How to implement GOMONTH function