I think the problem is that the indexes on the words are not usable for regular expression matching. If the words are folded to lower case when the index is built, then using an exact match (or even like) should be much faster. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html