splitting out the most-used event query from a more complicated occasional one
Merge branch 'lornajane-event-query-optimisation'