get posts and postmetas in assoc array

how do I get all posts and postmetas in an associative array?

$allposts = $wpdb->get_results("
SELECT $wpdb->posts.post_title, $wpdb->postmeta.meta_key
FROM $wpdb->posts
JOIN $wpdb->postmeta 
ON $wpdb->postmeta.post_id = $wpdb->posts.id
WHERE $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_status ='publish';", OBJECT_K);

I just don’t get it….

Solutions Collecting From Web of "get posts and postmetas in assoc array"