[wp-trac] [WordPress Trac] #3174: SQL cacher

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 27 20:22:57 GMT 2006


#3174: SQL cacher
--------------------------+-------------------------------------------------
 Reporter:  quix0r        |       Owner:  anonymous
     Type:  enhancement   |      Status:  new      
 Priority:  normal        |   Milestone:           
Component:  Optimization  |     Version:  2.1      
 Severity:  normal        |    Keywords:  sql,cache
--------------------------+-------------------------------------------------
 First of all here is a list of what I have changed and why:

 - Direct accesses on class fields replaced with getter/setter methods.
 This is about better security - currently only in Java but in PHP6, too! -
 and a better "design of code". There is a good guideline on Sun's webpage
 which you shall read and follow when you code object-orientated.

 - Fetching RSS feeds on the dashboard can now sitched off by a constant.
 Put this one line to your wp-config.php:

 define('DISABLE_RSS_FETCH', true);

 You may need this if you want to use WP behind proxies installed on your
 company's workstation (*always* ask for permission! This can be a reason
 for getting fired). I will start another topic about this after I have
 finished this.

 - Closing the database connection is implemented by a shutdown-function in
 wp-settings.php. This is always a good idea... ;-)

 - SQL query cacher in alpha state added. This is my youngest baby and it
 shall reduce the number of queries on your database and increase the speed
 of your blog. Remember every request must be *send* to the database. Even
 when it is over a uni* socket (on Linux boxes the most case) its still
 slower than loading a "local" file. PHP needs to send the request over
 it's library to the SQL process, the SQL process loads some database files
 and processes them. Then the result got sent back to the PHP library.

 Okay, you told me that your SQL queries are already optimized but 19 (!)
 SELECTs are still 19 queries and way too much for high-usage blogs.

 Does someone know what kind of SQL statement (SELECT, UPDATE, INSERT or
 DELETE) is the most used? My opinion on this is SELECT.

 Surely this cacher needs some improvement, including the compression
 methods. The functions gzcompress() and base64_encode() which are being
 used in my cacher are currently slowing down the blog too much. So let's
 have a look for faster PHP fucntions.

 The cacher also has a built-in debugging function which displays some
 arrays. You can enable it with this:

 define('DEBUG_SQL_CACHE', true);

 The cacher itself can be enabled with this:

 define('ENABLE_SQL_CACHE', true);

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3174>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list