MDL-42882 upgrade: improved SQL query
authorDan Poltawski <dan@moodle.com>
Mon, 3 Feb 2014 04:42:35 +0000 (12:42 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 3 Feb 2014 09:29:51 +0000 (17:29 +0800)
commit40c761e01afa8ab3dd1df54dd3093529db81c698
treeb45e44ee0a536f67b8e014cfa3b52885eab3ec1f
parent119cf17eeceebd0f94e4c82691893caa8f2a7a45
MDL-42882 upgrade: improved SQL query

Kudos to Tim Hunt who came up with this, on mysql with 4 milion
records (and a fast SSD) the performance difference is:

Original: 36.83 sec
New query: 8.63 sec
lib/upgradelib.php