On Nov 17, 2011, at 14:24, Joseph Shraibman wrote:
> This query is taking much longer on 9.1 than it did on 8.4. Why is it
> using a seq scan?
Without seeing the table definition (including indexes) as well as the output of EXPLAIN for 8.4, it's kind of hard to
say.
Does this formulation of the query give you a different plan?
SELECT status,
e4.type IS NOT NULL,
e1.type IS NOT NULL
FROM maillog ml
LEFT JOIN eventlog e4 ON (e4.uid, e4.jobid) = (ml.uid, ml.jobid)
AND e4.type = 4
LEFT JOIN eventlog e1 ON (e1.uid, e1.jobid) = (ml.uid, ml.jobid)
AND e1.type = 1
WHERE jobid = 1132730;
Michael Glaesemann
grzm seespotcode net