select * from products p
left join product_categories pc on p.id=pc.product_id
where pc.product_id is null
will return all products in table products that are not found in product_Category. LEft join and where is very fast. 30k records is also very little, so don't worry there.