Support » Plugins » subqueries vs. separate queries

  • Resolved AndreSC


    Say for argument’s sake I was silly enough to have plugin modify $wp_query before it is run, what would be better, to insert a sub-query or to first separately run the queries I need to run and patch the query via php?

    I was assuming the subquery route would perform better, but I also see not all versions of MySQL supports e.g. LIMIT in sub-queries – which, purely rhetorically of course, I might want/need to use.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The problem here, if you’re considering releasing the plugin, is that WordPress still supports MySQL 4.0, which does not allow subqueries *at all* (4.1 and up; I don’t know of restrictions to LIMIT in a subquery though).

    If you can figure a way of rewriting your subquery into the query, that would be best. Other than that, ‘running then patching’ would be the most beneficial alternative.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘subqueries vs. separate queries’ is closed to new replies.