Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Filtering by 'meta' vs 'taxonomy' – any difference in query speed/performance?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Odom
    #204995

    Hi all – I’ve got a quick question.

    I’m in the process of setting up a site and am trying to work out the best practices to future proof the site. The site will allow users to download files. I currently have it set up so that they can filter the files by software, version or required plugins, with those versions and plugins as custom taxonomies that I categorize each post against.

    I of course also have the alternate option of setting those values as custom fields for each post. Using ACF, this would even allow me to set default values for new posts – which would be good for me as I will be allowing users to submit files to the site eventually and this would make submission/admin much easier.

    Anyway, the question is: Does filtering by ‘meta’ vs filtering by ‘taxonomy’ using the S&F Pro plugin have any effects on the speed of the database query or rendering of the results at all? For example if there were eventually say 10,000 posts to filter, would either approach (meta vs taxonomy) have a performance benefit? Or does it make no difference whatsoever?

    Thanks!

    Trevor Moderator
    #205000

    Hi Oran

    Taxonomy is faster, but won’t do numerical things like date ranges, range slider, sorting, etc.

    This is because taxonomies are stored by their ID, so the SQL queries are always numeric comparisons, whereas post meta is often a string comparison which are generally slower. So post meta where numerical data should be used where you need to compare ranges like ranges (numbers or dates) or sorting, or taxonomy when the user wants a multiple “choice” scenario.

    Odom
    #205012

    Thanks Trevor! And that applies to the queries that S&F runs as opposed to just regular WordPress taxonomy queries?

    I’m not really a dev so don’t understand the finer details of it all, but does the fact that S&F is just querying it’s cache in the database rather than running ‘live’ search each time make any difference?

    And I know it’s difficult to say as it depends on the server and number of visitors – but in real world terms, does it actually make a difference in the end? Will an S&F taxonomy query be noticeably faster for the end user than an S&F meta query do you think?

    Thanks for bearing with me 🙂

    Trevor Moderator
    #205026

    The same basic speed difference applies.

    Using a cache, as S&F Pro does, substantially speeds up the search.

    As to real world difference, I cannot say. Too many variables in play.

    Odom
    #205040

    Thanks very much for your help Trevor, it’s much appreciated.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Filtering by 'meta' vs 'taxonomy' – any difference in query speed/performance?’ is closed to new replies.