Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In psql, with \timing on, query times are displayed in milliseconds + hundredths of milliseconds. In MySQL, they are only displayed in seconds + hundredths of seconds. Is there a way to get MySQL to display them in milliseconds too (I'm trying to compare queries, but the small times just come out as zero in MySQL, which isn't very helpful).

share|improve this question
Try set profiling=1; As suggested in… – wkoot Sep 16 '12 at 11:09

For a test/check session you can enable the Slow Query Log and setting the sysvar long_query_time to 0

The minimum and default values of long_query_time are 0 and 10, respectively. The value can be specified to a resolution of microseconds. For logging to a file, times are written including the microseconds part. For logging to tables, only integer times are written; the microseconds part is ignored

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.