1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | SELECT msg.id, m.login, MAX(msg.date_sent) AS most_recent_message, m.pasfoto, m.id AS mid, m.gender FROM mail_msg msg, members m WHERE msg.user_id = $auth AND msg.folder != '2' AND ((msg.user_from = $auth AND msg.user_to = m.id) OR (msg.user_to = $auth AND msg.user_from = m.id AND msg.verified = '1')) AND m.id != $auth GROUP BY m.id ORDER BY most_recent_message DESC LIMIT $from, $aantal_per_page |
1 2 3 | id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE msg ref from_user,to_user,user_id,verified user_id 4 const 191 Using where; Using temporary; Using filesort 1 SIMPLE m range PRIMARY,status,id_pswd-md5,login,country_id,state_... PRIMARY 3 NULL 20214 Using where; Using join buffer (Block Nested Loop) |
|
Forum Opties | |
---|---|
Forumhop: | |
Hop naar: |