开发者

Measure performance of SQL query in MySQL

开发者 https://www.devze.com 2023-02-28 15:12 出处:网络
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 was

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.

开发者_JAVA技巧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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号