MySQL Forums
Forum List  »  Newbie

Re: Performance Tunning
Posted by: Phillip Ward
Date: September 26, 2016 05:39AM

Quote

if we run simple query "select * from tablename;" and got slow response ...

Of course you're going to get a slow response.

Imagine you have a physical copy of the MySQL reference manual.

"select * from ..." means go and read every single page of that book and returned absolutely everything it contains.
The only way to "tune" this is to throw hardware are it - faster disks, faster memory, faster processors.

My question would be - does it even matter that this query is slow?
Really. In all likelihood, your application is never going to run this query as is!

When do you reach for "The Manual" (or Google)?
When you're looking for something specific.

How do you find it?
You go to the back, to the "Index", and there you scan through the entries to find the thing you want, say, "create user". Then, you use the page number(s) in the Index to go into the body of the book, to find the details of what you need.

MySQL does pretty much the same thing.

You're far more likely to run a query like this:
select x, y, z 
from table1 
where keyfield = 'value';

To do that efficiently, MySQL works out how best to get to that data. If that turns out to be slow, then you can improve things within the database, using indexes and the like.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
September 23, 2016 03:36AM
September 23, 2016 08:39AM
September 23, 2016 08:46PM
September 23, 2016 09:23PM
September 23, 2016 09:48PM
September 24, 2016 12:58AM
Re: Performance Tunning
September 26, 2016 05:39AM


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.