简体   繁体   中英

Measure performance of SQL query in MySQL

I'm looking for the approach in testing performance of SQL queries in different conditions. For example I have 2 tables with identical structure and data, but one was partitioned, and another one wasn't. And I need to figure out time for select (with different conditions) and update.

Is there a standard way or approach for this purpose?

I have MySQL 5.1 running.

Thanks.

The times will change as the data in the tables changes.

A better alternative would be to use EXPLAIN PLAN on both schemas and see if one query has a higher cost than the other. That will remain true regardless of how the data changes. I'd choose on that basis rather than arbitrary timings from benchmarks.

It'll also tell you the benefit of adding indexes as your queries change.

Go with EXPLAIN PLAN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM