Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, there won't be an absolute list of dos and donts as the goal posts keep moving. MySql moved on in leaps and bounds between versions 4 and 5, and some fairly essential bug fixes for MySql seem to be around the corner (I'm thinking of the issue surrounding the use of <code>count(distinct col1) from ...</code>).</p> <p>Here are a couple of issues off the top of my head:</p> <ol> <li>don't rely on views to be able to use indexes on the underlying tables</li> </ol> <p><a href="http://forums.mysql.com/read.php?100,22967,66618#msg-66618" rel="nofollow noreferrer">http://forums.mysql.com/read.php?100,22967,66618#msg-66618</a></p> <ol start="2"> <li>The order of columns in indexes intended to be used by <code>GROUP BY</code> is important:</li> </ol> <p><a href="http://dev.mysql.com/doc/refman/5.1/en/group-by-optimization.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.1/en/group-by-optimization.html</a></p> <ol start="3"> <li><code>COUNT(DISTINCT)</code> is slow:</li> </ol> <p><a href="http://www.delphifaq.com/faq/databases/mysql/f3095.shtml" rel="nofollow noreferrer">http://www.delphifaq.com/faq/databases/mysql/f3095.shtml</a></p> <ol start="4"> <li>although there might be a bug fix a-coming....</li> </ol> <p><a href="http://bugs.mysql.com/bug.php?id=17865" rel="nofollow noreferrer">http://bugs.mysql.com/bug.php?id=17865</a></p> <p>Here are some other questions from this site you might find useful:</p> <p><a href="https://stackoverflow.com/questions/579244/mysql-database-optimization-best-practices">Database opimization</a></p> <p><a href="https://stackoverflow.com/questions/1123011/quick-tips-on-relational-database-design-for-mysql">Database design with MySql</a></p> <p><a href="https://stackoverflow.com/questions/1092533/looking-for-mysql-optimization-and-fine-tuning-tips">Finetuning tips</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload