Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My question : how many custom fields or even taxonomies WordPress can handle without affecting performance?

The reason I ask, is because I started building a custom theme and I might need to have around 10 to 20 custom fields, and thinking if this will affect the speed of the site.

I understand that speed also depends on server/hosting and number of visits, cache techniques, etc...

I also expect that a post with one custom field will be faster then one post with ten custom fields.

But, let's say a site that haves around 10,000 visits a day with a post with one custom field will the speed difference be much more different from a site with the same 10 000 visits a day with a post with 10 custom fields.

Just trying to figure it out how much of a difference a custom field can make.

Also in terms of custom searching using wp_query and custom fields parameters will the speed be affected.

Thank you.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

In the case of custom fields- if you fetch them in a single query to the database, fetching one or ten is not going to differ much, it's the same relatively simple query in both instances. If you were to do a lot of complex meta queries on those fields you'd definitely see a performance hit.

I think same for taxonomy, if you're doing complex taxonomy queries, that's a big hit. Simple queries to fetch terms are relatively cheap.

Searching will certainly tax the server more if you've got ten times as much data, text searches are pretty expensive.

share|improve this answer
    
thank you. By single query to the database, do you mean custom query? At the moment I use: codex.wordpress.org/Function_Reference/get_post_meta will this make 10 hits to the database to grab the 10 custom fields of the same post? –  yeope Jun 6 '11 at 17:56
    
@yeope - a single query meaning either your own sql, or the underlying query generated when you use a WordPress function. I believe all of the simple meta functions ultimately call get_metadata, you can see how it works in /wp-includes/meta.php. It gets the whole object and puts it in cache, or grabs from cache if it's already there. It then checks if a key was passed or not and either returns just that key or the whole object. –  Milo Jun 6 '11 at 18:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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