In 26937#comment:57 @wpdavis has a valid point about caching. It seems like we have been down the road of trying to use WP_Query in this function. This patch adds caching to an expensive sql query. This ticket should progress ahead of #26937