I found EXPLAIN (http://dev.mysql.com/doc/refman/5.0/en/using-explain.html) pretty useful during my project; rather than theories it shows the exact way the query is being resolved and if the indexes are being used rightly.
On Thu, Mar 7, 2013 at 6:06 AM, Sumana Harihareswara sumanah@wikimedia.orgwrote:
If you want your code merged, you need to keep your database queries efficient. How can you tell if a query is inefficient? How do you write efficient queries, and avoid inefficient ones? We have some resources around:
Roan Kattouw's
https://www.mediawiki.org/wiki/Manual:Database_layout/MySQL_Optimization/Tut... -- slides at https://commons.wikimedia.org/wiki/File:MediaWikiPerformanceProfiling.pdf
Asher Feldman's https://www.mediawiki.org/wiki/File:MediaWiki_Performance_Profiling.ogv -- slides at https://www.mediawiki.org/wiki/File:SQL_indexing_Tutorial.pdf
More hints: http://lists.wikimedia.org/pipermail/toolserver-l/2012-June/005075.html
When you need to ask for a performance review, you can check out https://www.mediawiki.org/wiki/Developers/Maintainers#Other_Areas_of_Focus which suggests Tim Starling, Asher Feldman, and Ori Livneh. I also BOLDly suggest Nischay Nahata, who worked on Semantic MediaWiki's performance for his GSoC project in 2012.
-- Sumana Harihareswara Engineering Community Manager Wikimedia Foundation