SQL query to count total number of post meta rows per post type
SELECT
p.`post_type`,
COUNT( pm.`post_id` ) as postmeta_count
FROM `wp_posts` as p
JOIN `wp_postmeta` as pm
ON (p.`ID` = pm.`post_id`)
GROUP BY p.`post_type`
ORDER BY
postmeta_count DESC,
p.`post_type` ASC