Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-39396

Add some developer warning on SQL's IN() abuse

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.4.3, 2.5, 2.6
    • None
    • Database SQL/XMLDB
    • MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE

    Description

      While working on MDL-27071 it was clear that IN() clauses using BIG number of params don't scale properly and should be considered abuse.

      This is about to decide:

      1) if we should start showing some DEV warning when the number of elements is over, say, 500 recommending to change the code to use one of these:

      • subqueries.
      • PHP chunks.
      • temp tables.

      2) fix bulk user actions with some of the techniques above because they are abusing the IN() clause (see MDL-27071 and linked issues there).

      Ciao

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              stronk7 Eloy Lafuente (stronk7)
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: