pyth0ner
pyth0ner

Reputation: 181

How to view the precise time of running an SQL statement ?

It's for mysql. In mysql, the default shows in seconds. I want the time unit to be accurated to milliseconds.

Upvotes: 1

Views: 134

Answers (3)

Devart
Devart

Reputation: 121902

Have a look at Query Profiler for MySQL queries.

Upvotes: 0

Denis de Bernardy
Denis de Bernardy

Reputation: 78413

Personally I tend to find it a better thing to do at the app level. A query can be slow for a multitude of reasons:

  • Dismal SQL statement
  • Network latency (send the SQL, bring back the result)
  • Parsing the result (eg date/datetime in ruby)

If you log the complete query time as seen by the app, you spot more bottlenecks.

Upvotes: 1

Related Questions