Welcome

首页 / 数据库 / MySQL / Mysql教程:性能跟踪语句

Mysql教程:性能跟踪语句2010-07-24杨涛原文链接:http://blog.chinaunix.net/u/29134/showart_480834.html

MYSQL5.0家族提供的性能跟踪器确实很爽。

要注意两点。

1、不过版本要在5.0.37之后

手册上介绍:(SHOW PROFILES and SHOW PROFILE were added in MySQL 5.0.37. )

Important

Please note that the SHOW PROFILE and SHOW PROFILES functionality is part of the MySQL 5.0 Community Server only.

2、变量profiling是用户变量,每次都得重新启用。

以下是我做的一些实验。数据很明显,就不多解释了。

mysql> use test

Database changed

mysql> set profiling=1;

Query OK, 0 rows affected (0.00 sec)

mysql> show tables;

+----------------+

| Tables_in_test |

+----------------+

| bag_item |

| bag_user |

| score |

| t |

+----------------+