Take the 2-minute tour ×
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. It's 100% free, no registration required.

I am seeing unexpected behavior with some MySQL performance.

When I run a simple query SELECT 1; on my local host (MySQL 5.6.x) using workbench, it executes in 0.000s, but the same query run on Amazon RDS (medium MySQL 5.5.x) takes almost 0.094s.

What could be causing this behavior?

share|improve this question

1 Answer 1

Are you running this test between RDS and MySQL workbench on your own machine?

The MySQL client (and MySQL workbench) are including the time it takes for RDS to return the value of "1" to your workstation (from my workstation on the other side of the world, the response from RDS US West takes 280ms).

If you try enabling profiling on the RDS service, you can see how long the query is really taking - it's completing on your RDS instance in fractions of a millisecond.

mysql> set profiling = 1;

Query OK, 0 rows affected (0.00 sec)

mysql> select 1;

1
1

1 row in set (0.27 sec)

mysql> show profiles;

Query_ID   Duration      Query
       1   0.00016200    select 1

mysql> show profile for query 1;

Status                  Duration
starting                0.000052
checking permissions    0.000008
Opening tables          0.000012
...
executing               0.000013
end                     0.000008
...
cleaning up             0.000003

12 rows in set (0.28 sec)

set profiling = 0;

Query OK, 0 rows affected (0.28 sec)
share|improve this answer

Your Answer

 
discard

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.