MDL-54582 accesslib: improve performance of load_course_context
authorTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 13 May 2016 19:36:30 +0000 (20:36 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 13 May 2016 19:36:33 +0000 (20:36 +0100)
commit795efd9c1b2cc3763a901b30003d4e5a5cfbdcf6
treef5a9d5ad1d0faef9b18a37d7b6767d779646e4ae
parent65cbefc403f3bcaeec35d45f98610c39c460007a
MDL-54582 accesslib: improve performance of load_course_context

The new query is logically equivalen, but much, much faster, at
least on Postgred. (15ms, instead of 700ms, in one example I tried
on the database for the OU's main Moodle site.)
lib/accesslib.php