mysql query, optimisation, speed up
how optimisation mysql query?
Now I use Limit function, don't use *.
how else can I spe开发者_JAVA百科ed up the operation?
Thanks
@lolalola, you will probably get better responses if you provide your query for people to look at.
Without that the best I can do is direct you to mySQL's documentation on optimization:
http://dev.mysql.com/doc/refman/5.0/en/optimization.html
You will probably get the most bang for your buck by reading up on the following:
- Statement optimization
- Indexes
To give you any specific advice, we'd need to see a specific query.
In general, the rules are simple:
- Select only what you need (no extra columns, no extra rows), including when
JOIN
ing - Create an
INDEX
on columns (or combinations of columns) that you're likely to use often, especially those you're using to filter results.
Optimizing a specific query will often involve subtle changes to grouping, joins, conditions, fields, and ultimately every part of the query, but of course that sort of attention requires having a specific query to work with.
精彩评论