I have a query that can only be done using straight SQL, but I need to loop through the returns as a set of posts. As I understand it, WP_Query automatically gets all the metadata for all the posts retrieved, and caches it for when get_post_meta is called. But since I have to use wpdb->query, I was wondering if there was anyway I could call another function after it with a set of like post ids, which would cache all their meta; this way I don't hit the database for every post in the loop.
Right now I am actually inner joining the fields I need from the post_meta, but this just seems like a bad (and messy) idea.
Thanks,
Max