The results of this query should be cached, and invalidated when a new purchase is made.  On sites where sales might be slow, it'd be silly to do this query on every sales log page.