MySQL Forums
Forum List  »  Optimizer & Parser

Re: SQL CACHE Not used. When it should be?
Posted by: Rick James
Date: August 17, 2010 08:34AM

How slow is
SELECT NO_SQL_CACHE * FROM MYUSERTABLE WHERE NAME=SUBSTRING_INDEX(USER(),'@',1);
without the Query cache? Is it really that slow?

That is probably not cached because the value "USER()" varies between users.

Will MYUSERTABLE be changed much? If it is changed frequently, the Query cache may be of little use anyway! Remember, _all_ entries for a table are purged whenever _any_ row is modified or inserted into that table.

SHOW TABLE STATUS LIKE 'MYUSERTABLE'; -- I would like to see its size and engine.
SHOW CREATE TABLE MYUSERTABLE; -- do you have an index on NAME?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: SQL CACHE Not used. When it should be?
1950
August 17, 2010 08:34AM


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.