← Back to team overview

mahara-contributors team mailing list archive

[Bug 1724603] A change has been merged

 

Reviewed:  https://reviews.mahara.org/8492
Committed: https://git.mahara.org/mahara/mahara/commit/4b1f57b90374b3cc772b1560e1d3d05184716128
Submitter: Cecilia Vela Gurovic (ceciliavg@xxxxxxxxxxxxxxx)
Branch:    master

commit 4b1f57b90374b3cc772b1560e1d3d05184716128
Author: issam.taboubi <issam.tab@xxxxxxxxx>
Date:   Thu Feb 1 14:07:01 2018 +1300

Bug 1724603: Adding 'owner' column to update for update_hierarchy_path()

To make use of the indexing on that colum to speed things up

behatnotneeded

Change-Id: I4503b8c4b600fea28de9ffff854ec1f40ea5a2e0
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1724603

Title:
  update_hierarchy_path in artefacts/lib.php hammers sql when copying
  collections

Status in Mahara:
  Fix Committed

Bug description:
  A teacher asked 40 students to copy a 15 page collection with numerous
  artefacts on each page, which crippled our mysql server.

  When testing it, even copying the collection once resulted in the web
  server timing out and raised the sql load incredibly.

  The code "update_hierarchy_path" in the artefact/lib.php on line 1423
  runs an sql query as below:

      `$sql = "UPDATE {artefact} SET path = ? || SUBSTR(path, ?) WHERE
  (path = ? OR path LIKE ? )";`

  The artefact table in Mahara does not index the `path` column, so
  whilst updating one artefact is not a major issue, but updating the
  path column for many artefacts hits the database massively.

  Indexing the path column (which is 1024 bytes) may not be a good
  solution long term, but either the query needs to be made more
  efficient or the column indexed.

  Mahara version 17.04_STABLE (updated about a month ago)
  Linux RHEL7
  MYSQL 5.6
  Browser is current chromium Version 61.0.3163.100 (but that is not relevant)

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1724603/+subscriptions


References