Skip to main content

Posts

Showing posts from May, 2010

Install PHP 5.3.0/Lighttpd On Debian (Lenny) With Imap, MySQL, Sqlite3 And ImageMagick Support

Install PHP 5.3.0/Lighttpd On Debian (Lenny) With Imap, MySQL, Sqlite3 And ImageMagick Support This tutorial covers the setup of PHP 5.3.0/Lighttpd on Debian (lenny) with imap, mysql, mysqli, sqlite3, ImageMagick and mycrypt support. For this tutorial I will assume you are logged in as root this is not advised. First we need to install the webserver: aptitude install lighttpd Now we install the packages needed for mysql and mysqli support. You will be promoted to enter a mysql root password - please use a strong password. aptitude install mysql-server mysql-client libmysqlclient15-dev Next install some packages php needs to compile. aptitude install libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm-dev libmcrypt-dev libmcrypt4 sqlite3 bzip2 build-essential l

Top 10 Sql Performance Tips

Top10SQLPerformanceTips [edit] Top 1000 SQL Performance Tips Interactive session from MySQL Camp I: Specific Query Performance Tips (see also database design tips for tips on indexes): 1. Use EXPLAIN to profile the query execution plan 2. Use Slow Query Log (always have it on!) 3. Don't use DISTINCT when you have or could use GROUP BY 4. Insert performance 1. Batch INSERT and REPLACE 2. Use LOAD DATA instead of INSERT 5. LIMIT m,n may not be as fast as it sounds. Learn how to improve it (if possible): http://www.facebook.com/note.php?note_id=206034210932 6. Don't use ORDER BY RAND() if you have > ~2K records 7. Use SQL_NO_CACHE when you are SELECTing frequently updated data or large sets of data 8. Avoid wildcards at the start of LIKE queries 9. Avoid correlated subqueries and in select and where clause (try to avoid in) 10. No calculated comparisons -- isolate indexed columns 11. ORDER BY and LIMIT work best with equalities and covered in