bd991d03cf
This significantly improves performance of accesslib queries, credit for the discovery of this solution goes to Andrew Masterton from OU.