S.R.Ganesan

Man is still The Most eXtrardinary Computer of all.

Top10SQLPerformanceTips

# Use EXPLAIN to profile the query execution plan
# Use Slow Query Log (always have it on!)
# Don’t use DISTINCT when you have or could use GROUP BY
# Insert performance

1. Batch INSERT and REPLACE
2. Use LOAD DATA instead of INSERT

# LIMIT m,n may not be as fast as it sounds. Learn how to improve it and read more about Efficient Pagination Using MySQL
# Don’t use ORDER BY RAND() if you have > ~2K records
# Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data
# Avoid wildcards at the start of LIKE queries
# Avoid correlated subqueries and in select and where clause (try to avoid in)
# No calculated comparisons — isolate indexed columns
More
Authored by

Jay Pipes, Sheeri Kritzer, Bill Karwin, Ronald Bradford, Farhan “Frank Mash” Mashraqi, Taso Du Val, Ron Hu, Klinton Lee, Rick James, Alan Kasindorf, Eric Bergen, Kaj Arno, Joel Seligstein, Amy Lee, Sameer Joshi, Surat Singh Bhati

December 27, 2010 Posted by | PHP, Uncategorized | , , | Leave a Comment

   

Follow

Get every new post delivered to your Inbox.