MySQL Forums
Forum List  »  Performance

Re: Expected query time?
Posted by: Rick James
Date: November 22, 2011 09:01PM

> takes 0.0007 sec., however if I wait a bit and don't use the table, it will sometimes take up to 0.006 sec.
Either of those times is down in the 'noise'.

If the Query cache is turned ON, then you could be experiencing a boost that way.

> This code took 0.0279 sec to execute. Isn't that a bit slow for a fairly small table using primary index?
If nothing was in RAM when you ran the query, it probably had to make at least 2 disk hits -- one for the INDEX, one for the row. The ENGINE makes a big difference. The PK makes a big diff -- Is it just (ID), or is it (ID, other_columns)?

Did you run that one again? If so, how long did it take? What about with a different ID?

Please provide these:
* SHOW CREATE TABLE tbl\G -- engine, indexes
* SHOW TABLE STATUS LIKE 'tbl'\G -- sizes
* EXPLAIN SELECT ...\G -- clues of inefficiencies
* SHOW VARIABLES LIKE '%buffer%'; -- cache size
* SHOW VARIABLES LIKE 'query%'; -- query cache
and surround them with [ code ] and [ / code ]
How much RAM do you have?

Options: ReplyQuote


Subject
Views
Written By
Posted
2857
November 21, 2011 04:08PM
Re: Expected query time?
1004
November 22, 2011 09:01PM
911
November 24, 2011 03:47PM
1244
November 25, 2011 01:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.