On Wed, Jun 22, 2005 at 02:03:29AM -0700, Aditya Damle wrote:
> Hello. I believe in earlier versions, a query of the
> form 
> select attrib from ttt where attrib like 'foo%' would
> be able to take advantage of an index. I have seen
> this in the past. Currently I am using v8.0.3. From
> what I can see is that the execultion plan seems to
> use a seq scan and to totally ignore the index. Is
> this the case?

8.0.3 can certainly use indexes for LIKE queries, but the planner
will choose a sequential scan if it thinks that would be faster.
Have you vacuumed and analyzed your tables?  Could you post the
EXPLAIN ANALYZE output of a query, once with enable_seqscan turned
on and once with it turned off?

See also "Operator Classes" in the "Indexes" chapter of the


What locale are you using?

Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not

Reply via email to