Re: [PERFORM] Interesting slow query

2006-06-13 Thread PFC
Usually we get complaints the other way around (that the NOT EXISTS approach is a lot slower). Yes, I know ;) (I rephrased the query this way to exploit the fact that the planner would choose a nested loop) You did not show any statistics, but I suspect the key point here is that

Re: [PERFORM] Interesting slow query

2006-06-12 Thread Tom Lane
PFC <[EMAIL PROTECTED]> writes: > Here are two ways to phrase a query... the planner choses very > different > plans as you will see. Everything is freshly ANALYZEd. Usually we get complaints the other way around (that the NOT EXISTS approach is a lot slower). You did not show any statis

[PERFORM] Interesting slow query

2006-06-12 Thread PFC
Here are two ways to phrase a query... the planner choses very different plans as you will see. Everything is freshly ANALYZEd. EXPLAIN ANALYZE SELECT r.* FROM raw_annonces r LEFT JOIN annonces a ON a.id=r.id LEFT JOIN archive_data d ON d.id=r.id WHERE a.id IS NULL AND d.id IS NULL AND