Count the time each SQL statement executes in MySQL

Source: Internet
Author: User

Overview

Usually to test the performance of some tools, you have to use data to speak. The data can be objectively verified by some things. For example, the performance of some database middleware, for a beginner will only see the surface of the Kua. We have to prove it, then test it with a specific query statement. However, often in the execution of a statement, helplessly looking at the black screen of a class of clients, can not help dozing wandering, statistics also headache.

Method

Open MySQL Client

mysql-h127.0.0.1-uroot-proot-p3306

Select Database

Use dbtest;

Set profiling

Set profiling=1;

Execute SQL statement (there is a large amount of data here)

Select COUNT (*) from test;
Results
Show profiles;+----------+-------------+------------------------------------------------+| query_id | Duration | Query |+----------+-------------+------------------------------------------------        +| 1 | 89.45164725 | Select COUNT (*) from test |+----------+-------------+------------------------------------------------ +


Count the time each SQL statement executes in MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.