The following query takes a very long time to process. It finally returns
only the row I'm wanting, but when I run an EXPLAIN SELECT on it, it looks
like all 14687 rows are being examined for the record -- instead of mysql
honing in on the desired row immediately.
SELECT
call_notes.call_elapsed,
call_notes.call_seconds,
call_notes.call_start,
call_notes.call_end,
call_notes_text.note_text,
users.username,
users.namefirst,
users.email,
facility_contact.contactid,
facility_contact.contact
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
ORDER BY
call_notes.call_start DESC;
(results snipped)
1 row in set (17.89 sec)
A variable called $ticketid is passed to this query (and is placed where the
'1' is above). The ticketid is the key I use across several tables. It
is a field in call_notes and that is how I'm getting the noteid (which is
the primary key of call_notes and call_notes_text). I will post details on
the tables if needed.
Any help or guidance appreciated.
---------------------------------------------------------------------
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