I have a set of ~4700 records that I need to have locally searchable for my plugin via an auto-complete (it's the Google Product Search categories). Would it be okay to store this data in the options table as an array or would it be better to actually create a separate table in which to store this data?

It's about 317k. Would I be asking for trouble if I just stored it as an array in the options table? Does each page load cache all the site options?

1 Answer 1


Each page load triggers a database query that reads all the options (from what I'm aware the option records are all auto-loaded).

Anyway 317 K is not something you should worry about, but there are better ways to store your data, for example a simple text file that gets read trough ajax only when the search is being made (first character typed I guess).

You can cache the data after the first load if you want, using wp_cache_set() (and delete it when you're updating the list). You need some persistent object cache plugin to keep it across page requests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.