Does this mean postgres has trouble with left joins. Afaik, both queries are equivalent. Mysql treats them exactly the same, according to the docs and analyze.

Or could this be related to the index bloat Matthew and Jesse have been 
discussing?


Sergey Spiridonov wrote:
Sergey Spiridonov wrote:

problem is in query: SELECT messageblk FROM dbmail_messageblks LEFT JOIN
dbmail_messages USING (physmessage_id) WHERE
dbmail_messages.message_idnr = '551047' ORDER BY messageblk_idnr

which takes up to 6 seconds!!!


Slightly rewritten query

SELECT messageblk FROM dbmail_messageblks, dbmail_messages WHERE dbmail_messageblks.physmessage_id = dbmail_messages.physmessage_id AND dbmail_messages.message_idnr = '551047' ORDER BY messageblk_idnr;

is executed quickly. But I'm not sure if it will do exactly the same.

--
  ________________________________________________________________
  Paul Stevens                                         [EMAIL PROTECTED]
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands_______________________________________www.nfg.nl

Reply via email to