"Othman Laraki" <othman(at)epitrope(dot)com> writes:
> THE QUERY
> =========
> SELECT a1.tid, x2 FROM ep_tbl_cache, ep_tbl_page_topic_map as a1 WHERE
> x1=a1.pid AND x1 is not null and x1 <> '' and x1 <> '-' AND
> ep_tbl_cache.identifier = 'bg2hyr0p51_cached_Thu May 03 13:43:07 PDT 2001';
The only available join clause here is x1=a1.pid. Unfortunately,
x1 is VARCHAR(100) and a1.pid is INT8. To get a more reasonable
join plan, try fixing your table declarations so that the join
clause doesn't involve a forced type conversion.
regards, tom lane