MySQL /G output
Posted
by conandor
on Server Fault
See other posts from Server Fault
or by conandor
Published on 2010-04-02T07:26:47Z
Indexed on
2010/04/02
7:33 UTC
Read the original article
Hit count: 445
mysql
I ran mysql query as below
on a non-partition table
mysql> use test31
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> explain partitions SELECT * FROM my_friends WHERE (requestor = '1234567890' OR contact = '1234567890') AND status = 1 ORDER BY request_id DESC LIMIT 0,100\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: my_friends
partitions: NULL
type: index_merge
possible_keys: friend_index,requestor,contact
key: friend_index,contact
key_len: 17,17
ref: NULL
rows: 2
Extra: Using sort_union(friend_index,contact); Using where; Using filesort
1 row in set (0.00 sec)
on a partition table
mysql> explain partitions SELECT * FROM my_friends WHERE (requestor = '1234567890' OR contact = '1234567890') AND status = 1 ORDER BY request_id DESC LIMIT 0,100\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: my_friends
partitions: p1_p1sp0,p1_p1sp1,p1_p1sp2,p1_p1sp3,p1_p1sp4,p1_p1sp5,p1_p1sp6,p1_p1sp7,p1_p1sp8,p1_p1sp9,p1_p1sp10,p1_p1sp11,p1_p1sp12,p1_p1sp13,p1_p1sp14,p1_p1sp15,p1_p1sp16,p1_p1sp17,p1_p1sp18,p1_p1sp19,p1_p1sp20,p1_p1sp21,p1_p1sp22,p1_p1sp23,p1_p1sp24,p1_p1sp25,p1_p1sp26,p1_p1sp27,p1_p1sp28,p1_p1sp29
type: index_merge
possible_keys: friend_index,requestor,contact
key: friend_index,contact
key_len: 17,17
ref: NULL
rows: 60
Extra: Using sort_union(friend_index,contact); Using where; Using filesort
1 row in set (0.01 sec)
What does the "rows" mean? less rows is more faster query?
© Server Fault or respective owner