How to check performance of mysql query?

Anand Singh

I have been learning query optimization, increase query performance and all but in general if we create a query how can we know if this is a wise query.

I know we can see the execution time below, But this time will not give a clear indication without a good amount of data. And usually, when we create a new query we don't have much data to check.

I have learned about clauses and commands performance. But is there is anything by which we can check the performance of the query? Performance here is not execution time, it means that whether a query is "ok" or not, without data dependency.

As we cannot create that much data that would be in live database.

teddyjm

General performance of a query can be checked using the EXPLAIN command in MySQL. See https://dev.mysql.com/doc/refman/5.7/en/using-explain.html

It shows you how MySQL engine plans to execute the query and allows you to do some basic sanity checks i.e. if the engine will use keys and indexes to execute the query, see how MySQL will execute the joins (i.e. if foreign keys aren't missing) and many more.

You can find some general tips about how to use EXPLAIN for optimizing queries here (along with some nice samples): http://www.sitepoint.com/using-explain-to-write-better-mysql-queries/

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to check what is causing performance issue

分類Dev

How to improve query performance on a single node in MonetDB?

分類Dev

How to improve performance of this SQL Server query?

分類Dev

mysql query to check a field exist in an array in codeigniter

分類Dev

Java how to check if mysql is running

分類Dev

How to check duplicate value in MySQL

分類Dev

how to convert mysql query to zend query?

分類Dev

How to combine "LIKE" with "IN" in a MYSQL query?

分類Dev

How to order a MySQL query by range?

分類Dev

How to pass & symbol in MySQL query?

分類Dev

How to improve the text column performance in below mentioned SQL query

分類Dev

CosmosDB Query Performance

分類Dev

Spark performance issue at NOT IN query

分類Dev

Optimizing SQL Query performance

分類Dev

Clickhouse - query performance degradation

分類Dev

Improve SimpleMembership query performance?

分類Dev

Query performance with insufficient RAM

分類Dev

How to check event scheduler status mysql

分類Dev

How to check if a user requires SSL in Mysql?

分類Dev

how to order column in Multi-columns index for best performance in Mysql

分類Dev

how to improve mysql query speedy with indexes?

分類Dev

How to get database structure in MySQL via query

分類Dev

How to get a mysql query to use a specific index?

分類Dev

How to do multiple counts in a MYSQL select query?

分類Dev

How to display zero values in mysql query?

分類Dev

How to escape a period in mySql JSON query

分類Dev

How to do this query against MySQL database table?

分類Dev

How to use common parameter for Mysql PDO query

分類Dev

Mysql: How to query with if else condition inside if

Related 関連記事

ホットタグ

アーカイブ