看看我们的 Query 的执行计划:
1 sky@localhost : example 11:17:04> explain select m.subject msg_subject, c.content msg_content
2
3 -> from user_group g,group_message m,group_message_content c
4
5 -> where g.user_id = 1
6
7 -> and m.group_id = g.group_id
8
9 -> and c.group_msg_id = m.id\G
10
11 *************************** 1. row ***************************
12
13 id: 1
14
15 select_type: SIMPLE
16
17 table: g
18
19 type: ref
20
21 possible_keys: user_group_gid_ind,user_group_uid_ind,user_group_gid_uid_ind
22
23 key: user_group_uid_ind
文章来源于领测软件测试网 https://www.ltesting.net/