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.

I have custom type posts that I need to separate by year as the posts are entries in an annual contest. Would it be better in the long run for efficiency of queries, speed, etc to simply use the built in post date or set up a custom taxonomy to group these posts into years?

I notice that post_date is stored in the wp_posts table, so it seems to me that this would make for speedier queries than having to reference the separate taxonomy table.

Thank you!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I can't see any practical reason to use a custom taxonomy here. You can already query posts by year using OOB query and archive stuff (see this Codex article about the "year" WP_Query parameter, and this one about the "yearly" mode for wp_get_archives()).

If you're asking purely about performance, I'd consider this kind of thing (a single table query vs. a simple join) a "micro-optimization". For 95% of WordPress sites, it won't make any visible difference. And if your site is at the point where you need serious tuning, there are probably better places to focus energy (like identifying really slow queries, and having a good caching strategy).

Hope that helps?

share|improve this answer
    
Exactly what I was looking for. You confirmed what I suspected. Thanks @MathSmith! –  Adam Jan 31 '13 at 16:59
add comment

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.