Patrick Hatcher <> writes:
> The following SQL takes 4+ mins to run. I have indexes on all join fields
> and I've tried rearranging the table orders but haven't had any luck.
Please show EXPLAIN ANALYZE output, not just EXPLAIN. It's impossible
to tell whether the planner is making any wrong guesses when you can't
see the actual times/rowcounts ...
(BTW, 7.4 is looking pretty long in the tooth.)
regards, tom lane