开发者

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:

  1. Select only what you need (no extra columns, no extra rows), including when JOINing
  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜