-2

OK, I know (because i've read it many times) why custom fields is less efficient than custom taxonomies when it comes to querying/filtering posts, but just how inefficient is it by comparison? I'd love some researched quantitative statistics to back this up.

What sort of number of posts and custom fields are we talking about before my website collapses?

  • I should note, that the custom field set up I am using only allows defined values to choose from. That is, the values are set in place and generally won't be added to. Having said that some custom fields have 800 values. – Pete Oct 10 '15 at 17:28
  • 3
    The only real answer will come from you doing tests with your own data on your own hardware with your own configuration. – Milo Oct 10 '15 at 19:17
  • @Milo I think that would do as an answer, maybe with a bit more explanation :) – Rarst Oct 10 '15 at 19:31
  • How would I test this? What variables would I need to measure? – Pete Oct 11 '15 at 1:40
  • 2
    I'm voting to close this question as non constructive as the user is looking for concrete numbers. It is impossible to test due the large amount of factors involved, and the fact that almost no one has such large local installs to test this on – Pieter Goosen Oct 11 '15 at 13:17
3

The trouble with meta queries is they require an additional join per filter. Say you have a property site, and you're searching by location, rooms and price. That's three joins. If you were using taxonomies, just two (terms and term_taxonomy) - no matter how many filters.

The other reason taxonomies tend to beat meta queries is their db schema. They're well indexed and optimised for searching - the meta table, whilst indexed on meta keys, has a value field that's large text - start querying on that bad boy (especially LIKE statements) and MySQL will have to take a breath or two.

Having said all that, meta queries have their place and can be extremely useful (with caution). And to be honest, unless you've got thousands of posts, or you're applying several meta queries, the difference will probably be negligible.

|improve this answer|||||
  • Thanks, like everything else I've read your answer makes complete sense as to why. But I'm really looking for some real world examples backed up by some measurable quantitative numbers that supports this poor performance comparison. Everyone says what you're saying but I've yet to see ANY evidence of it. – Pete Oct 11 '15 at 1:36
  • @Pete The only way you'll get measurable comparisons is to provide an exact scenario - there are too many unknown variables to conclusively say X is better than Y. – TheDeadMedic Oct 11 '15 at 7:33
  • Yes I understand that. But I'd like to see anyone's example of testing where they've demonstrated a significant, and measurable, difference. I've searched high and low and not found a single example (with quantitative data) showing what everyone is theoretically telling me. It would be great if there was someone out there that could trial several different scenarios to show evidence of this CF Vs CT issue. – Pete Oct 11 '15 at 8:11
  • But their example will be useless unless it closely matches your requirements - can you briefly explain to me what you're intending to achieve/implement? – TheDeadMedic Oct 11 '15 at 8:14
  • 1
    @Pete Looking at this answer, and large amount of comments to his answer and your question, this really is a lack of interest to test this yourself. I really do not think anyone of us has such a large local install to test this for you. This whole exercise is really pointless and worthless testing this on a small local install, and it is also pointless for us spending days setting up such a huge local install to test this. You really need to take in account nesting, hierarchy, server hardware etc etc etc. I'm close voting this as non constructive – Pieter Goosen Oct 11 '15 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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