On 3 Jun 2002, at 11:49, Stembridge, Michael wrote: > FROM > call_notes, > call_notes_text, > users, > facility_contact > WHERE > call_notes.ticketid = '1' && > call_notes.userid = users.userid && > call_notes.contactid = facility_contact.contactid && > call_notes_text.noteid = call_notes.noteid
I've found that LEFT JOIN can be useful in getting MySQL to process tables in the best order. (It also can make problems with your tables more obvious, if records are missing from one of the joined tables.) Try changing that to FROM call_notes c LEFT JOIN call_notes_text ct ON c.noteid = ct.noteid LEFT JOIN users u ON c.userid = u.userid LEFT JOIN facility_contact f ON c.contactid = f.contactid WHERE c.ticketid = 1 and see how your EXPLAIN result changes. -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php