---
title: "MySQL调优"
author: "alex09"
date: "2010-01-11T01:03:37Z"
tags: ["MySQL"]
categories: ["非技术"]
slug: "mysql"
draft: false
lastmod: "2010-01-11T01:03:56Z"
id: 567165
url: "https://alex09.iteye.com/blog/567165"
---

   最近有一个project是优化mysql的效率。
   首先是select count(*) 和select(id)
mysql> select count(*) from nim_acl_action;
+----------+
| count(*) |
+----------+
|  2230164 |
+----------+
1 row in set (20.73 sec)
mysql> select count(id) from nim_acl_action;
+-----------+
| count(id) |
+-----------+
|   2230164 |
+-----------+
1 row in set (8.61 sec)
相差效率1.5倍