On Thursday 15 March 2007 15:05, Rodrigo De León wrote:

> From http://www.postgresql.org/docs/8.2/static/indexes-types.html :
> 
> "The optimizer can also use a B-tree index for queries involving the
> pattern matching operators LIKE and ~ if the pattern is a constant and
> is anchored to the beginning of the string ? for example, col LIKE
> 'foo%' or col ~ '^foo', but not col LIKE '%bar'."

It made the query faster (1500 instead of 2500 ms), but not fast enough. But,
this is good to know, although I often need the '%foobar%' search string...


---------------------------(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
       match

Reply via email to