Re: [GENERAL] Slow left outer join

2006-11-27 Thread Alexander Staubo
On Nov 27, 2006, at 02:45 , Tom Lane wrote: Alexander Staubo <[EMAIL PROTECTED]> writes: select comments.*, users.* from comments left outer join users on users.id = comments.creator_id inner join events_comments on comments.id = events_comments.comment_id and events_comments.event_id

Re: [GENERAL] Slow left outer join

2006-11-26 Thread Tom Lane
Alexander Staubo <[EMAIL PROTECTED]> writes: > select comments.*, users.* > from comments > left outer join users on >users.id = comments.creator_id > inner join events_comments on >comments.id = events_comments.comment_id >and events_comments.event_id = 9244 > The outer join seems unn

Re: [GENERAL] Slow left outer join

2006-11-26 Thread Richard Broersma Jr
> The outer join seems unnecessarily slow. Is there anything I can do > to speed it up? > > PostgreSQL 8.1.3 on OS X (MacPorts). This is just a guess on my part, but would it help if you preformed the inner join first to filter out the most of the unwated rows that then preform the outer join

[GENERAL] Slow left outer join

2006-11-26 Thread Alexander Staubo
I have thee primary tables: comments, events and users. There's a join table events_comments tying comments to events. There are B-tree indexes on every column involved, and the tables are freshly vacuumed and analyzed; A simple select to retrieve all comments for a given event, with an o