[wp-hackers] Quantity of Queries - Performance

Joost de Valk joost at yoast.com
Mon Mar 30 21:39:08 GMT 2009


That's the point Otto, if the option doesn't exist, it can't be auto 
loaded :) Quite a few plugin authors don't set the option until there's 
a change to the default settings, causing a query for a non existent 
option...

Otto wrote:
> Getting an option shouldn't cause a query if the autoload is set to
> true (which I believe is the default), as the option would have
> already been loaded in the initialization of WP.
>
> -Otto
> Sent from: Memphis Tennessee United States.
>
>
> On Mon, Mar 30, 2009 at 2:33 PM, Joost de Valk<joost at yoast.com>  wrote:
>    
>> Hey,
>>
>> I've been playing with this plugin a bit, and submitted a patch to Frank who
>> was kind enough to immediately commit it, based on my experiences I've
>> written a post on it: http://yoast.com/wordpress-performance-optimization/
>>
>> There's one paragraph in there that everyone should take note of about empty
>> options, in short:
>>
>>     doing a get_option to check whether a certain option is set or not, is
>> actually more expensive,
>>     database wise, than just setting the option and leaving it empty, as it
>> causes a query...
>>
>> Might be good to know for the plugin authors out there!
>>
>> Best,
>> Joost
>>
>> Frank Bueltge wrote:
>>      
>>> or you use the plugin: http://wordpress.org/extend/plugins/debug-queries/
>>> and read all your queries in the footer area, only for loged admins
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>>        
>> --
>> me *Joost de Valk*
>> Online Marketing, WordPress, SEO&  Social Media Strategy
>> OrangeValley<http://www.orangevalley.nl>  &  Yoast<http://yoast.com>
>> E: joost at orangevalley.nl<mailto:joost at orangevalley.nl>  - joost at yoast.com
>> <mailto:joost at yoast.com>
>> T: +316-24-555-808 | @yoast<http://twitter.com/yoast>  on Twitter
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>>      
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>    

-- 
me *Joost de Valk*
Online Marketing, WordPress, SEO & Social Media Strategy
OrangeValley <http://www.orangevalley.nl> & Yoast <http://yoast.com>
E: joost at orangevalley.nl <mailto:joost at orangevalley.nl> - 
joost at yoast.com <mailto:joost at yoast.com>
T: +316-24-555-808 | @yoast <http://twitter.com/yoast> on Twitter


More information about the wp-hackers mailing list