Monday, March 22, 2010

[MySQL]optimization

EXPLAIN (瞭解MySQL如何處理select)
   Ex: EXPLAIN select * from users.users

GROUP BY xxx,預設會對xxx欄位做sort,如果不希望sort要加ORDER BY NULL

Table欄位的順序也會影響到query的效率(primary key, unique index, index, normal columns)

No comments: