select 里面带的值居然是估算的?


mysql> set profiling=1;
Query OK, 0 rows affected, 1 warning (0.07 sec)

mysql> select count(1) from wl;
+----------+
| count(1) |
+----------+
| 2 |
+----------+
1 row in set (0.06 sec)

mysql> select count(*) from wl;
+----------+
| count(*) |
+----------+
| 2 |
+----------+
1 row in set (0.00 sec)

mysql> show profiles;
+----------+------------+-------------------------+
| Query_ID | Duration | Query |
+----------+------------+-------------------------+
| 1 | 0.05240750 | select count(1) from wl |
| 2 | 0.00019200 | select count(*) from wl |
+----------+------------+-------------------------+
2 rows in set, 1 warning (0.03 sec)

mysql> show profile for query 1;
+----------------------+----------+
| Status | Duration |
+----------------------+----------+
| starting | 0.000113 |
| checking permissions | 0.000010 |
| Opening tables | 0.000021 |
| init | 0.000037 |
| System lock | 0.000014 |
| optimizing | 0.000009 |
| statistics | 0.000017 |
| preparing | 0.000020 |
| executing | 0.000004 |
| Sending data | 0.051994 |
| end | 0.000010 |
| query end | 0.000012 |
| closing tables | 0.000011 |
| freeing items | 0.000123 |
| cleaning up | 0.000015 |
+----------------------+----------+
15 rows in set, 1 warning (0.02 sec)

mysql> show profile for query 2;
+----------------------+----------+
| Status | Duration |
+----------------------+----------+
| starting | 0.000040 |
| checking permissions | 0.000006 |
| Opening tables | 0.000019 |
| init | 0.000014 |
| System lock | 0.000007 |
| optimizing | 0.000005 |
| statistics | 0.000014 |
| preparing | 0.000015 |
| executing | 0.000003 |
| Sending data | 0.000034 |
| end | 0.000004 |
| query end | 0.000006 |
| closing tables | 0.000008 |
| freeing items | 0.000009 |
| cleaning up | 0.000011 |
+----------------------+----------+
15 rows in set, 1 warning (0.00 sec)

posted on 2014-10-15 13:51  zitong  阅读(198)  评论(0编辑  收藏  举报