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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.3, 2.5, 2.6
    • Fix Version/s: DEV backlog
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Affected Branches:
      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

              Assignee:
              moodle.com moodle.com
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: