After much futzing and fiddling I've determined, umm, well very little
regarding my problem but a little more about PG. The LIKE query does use
the index if and only if, the '%' is at the tail of the string and there
is only one '%' in the string. So LIKE 'MAIN%' does use the index but
LIKE '%MAIN%' won't. This was verified on the HACKERS list. This means
that the 'substring' query that I used should be a heck of a lot slower.
EXPLAIN bears this out where the 'substring' query looked at 15,000 rows
+- and the LIKE 'MAIN%' used 30 rows. In practise tho, I still wait for
the LIKE query for a lot longer than the 'substring' one. The problem, I
think I can safely say, is not here. Which leaves me with the setup,
implementation, memory usage, OS, permissions, etc.
Sorry for all the traffic and confusion. I'll report back when I figure
this out.
cheers
jb
--
This is the first age that's paid much attention to the future, which is
a
little ironic since we may not have one.
-- Arthur Clarke