WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] subqueries vs. separate queries (3 posts)

  1. AndreSC
    Member
    Posted 6 years ago #

    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.

  2. Kafkaesqui

    Posted 6 years ago #

    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.

  3. AndreSC
    Member
    Posted 6 years ago #

    thanx

Topic Closed

This topic has been closed to new replies.

About this Topic