+-------+--------------+------+-----+---------+-------+
| field | type | null | key | default | extra |
+-------+--------------+------+-----+---------+-------+
| uid | int(11) | no | | null | |
| sid | mediumint(9) | no | | null | |
| times | mediumint(9) | no | | null | |
+-------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
存储引擎是myisam,里面有10,000条数据。
一、“\g”的作用
mysql> select * from tbl_name limit 1;
+--------+--------+-------+
| uid | sid | times |
+--------+--------+-------+
| 104460 | 291250 | 29 |
+--------+--------+-------+
1 row in set (0.00 sec)
mysql> select * from tbl_name limit 1\g;
*************************** 1. row ***************************
uid: 104460
sid: 291250
times: 29
1 row in set (0.00 sec)有时候,操作返回的列数非常多,屏幕不能一行显示完,显示折行,试试”\g”,把列数据逐行显示(”\g”挽救了我,以前看explain语句横向显示不全折行看起来巨费劲,还要把数据和列对应起来)。
