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

Les Bessant les at lcb.me.uk
Fri Aug 8 13:29:49 GMT 2008

There definitely is a cut-off point, though I don't think you're in any
danger of getting there.

I recently had to abandon using a word count plugin which stored all its
data in one nicely serialised option. That would have been OK, except the
data comprised a count of words for each post, counts broken down in
various ways, assorted statistics and much more. It was over 300kb. Now
*that* might not have been too bad, but it rewrote the data every time a
post was saved. Or changed. And yes, a spam comment being blocked by
Akismet was enough to trigger it. 

I was wondering why my virtual private server was having insane memory
spikes. It wasn't untl someone sent me screen capture of MySQL getting
*really* upset that I worked it out...

The point of the story being that it wasn't until this huge option field
got to a very large size that there was any apparent issue.

On Fri, 8 Aug 2008 05:04:51 -0700, Viper007Bond <viper at viper007bond.com>
> I have a plugin (Viper's Video Quicktags) that I'm currently recoding
> 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
> 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
> 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

More information about the wp-hackers mailing list