[wp-hackers] Multiple options vs. one large serialized option

Benedict Eastaugh ionfish at gmail.com
Fri Aug 8 13:12:32 GMT 2008


Here's the code I use to manage Tarski's options, it's worked pretty
well for me.

http://code.google.com/p/tarski/source/browse/trunk/library/classes/options.php?r=741

2008/8/8 Viper007Bond <viper at viper007bond.com>:
> Anything in the admin area will be needed for the front end as well.
>
> I was thinking one per video format so that if the user only displayed
> YouTube videos for example then only the YouTube settings would be loaded,
> but with autoload they're already loaded and with autoload off that'd
> require an extra query so that doesn't make any sense.
>
> One "large" option it is. Thanks. :)
>
> On Fri, Aug 8, 2008 at 5:18 AM, Ozh <ozh at planetozh.com> wrote:
>
>> The only reason I would cut options in 2 sets would be for instance:
>> - set1 stored with autoload = yes, containing everything that you'll
>> need on blog pages
>> - set2 stored with autoload = no, containing everything needed for admin
>> area
>>
>> Therefore, a smaller set1 would be read on WP init, and you don't mind
>> adding an extra query when viewing an admin page to fetch set2
>>
>> But anyway I don't think it's really worth it avoiding to store
>> everything in one entry.
>>
>>
>> On Fri, Aug 8, 2008 at 2:04 PM, Viper007Bond <viper at viper007bond.com>
>> wrote:
>> > I have a plugin (Viper's Video Quicktags) that I'm currently recoding
>> from
>> > scratch and I'm wondering how I should store my options.
>> >
>> > I have a decent set of configuration variables (sizes, colors, etc.) so I
>> > can't decide if I should store them in one option or break them up a bit
>> > (like one per video format or something). I'm not storing huge chunks of
>> > text or anything crazy like that, just small strings and some variables.
>> >
>> > So what's the "cutoff" where it becomes more efficient to break it up
>> than
>> > store it in one big long serialized string in the database? Or is there
>> one?
>> > It'd be easier for me to store it all in one option, but I'm not sure
>> what
>> > would be best from a performance standpoint.
>> >
>> > --
>> > Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/
>> > _______________________________________________
>> > wp-hackers mailing list
>> > wp-hackers at lists.automattic.com
>> > http://lists.automattic.com/mailman/listinfo/wp-hackers
>> >
>>
>>
>>
>> --
>> http://FrenchFragFactory.net ~ Daily Quake News
>> http://planetOzh.com ~ Blog and WordPress Stuff
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
>
>
> --
> Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list