I have one product table like this:

```
productid    categoryid

```

and another category table like this:

```
categoryid   parentid

```

would like to find rows missing from product table

```
select distinct c.parentid, pc.productid, from products_categories pc
join categories c on pc.categoryid = c.categoryid
where  concat(pc.productid,'-',c.parentid) not in (
 select distinct concat(productid,'-',categoryid) from products_categories
)

```

however this is extremely slow. is there a way to do this with joins instead of the not in concat line? the concat is used to account for all possible combos.