I have main table product, it has subtables product_store_1, ... , product_store_N based on store_id field. Product table has rules, they insert new row to one of subtables depends on store_id. It seems to work fine, but main table currently is not empty and I want to get which rule is missed. I'm trying to
SELECT store_id,count(*) FROM product GROUP BY store_id;
But it runs for all product_store_N tables, I want to run this query only for parent table.