prueba con algo así
select count(tablacuenta.keyword_id) as numclaves,tablaproducto.product_id from tabla as tablacuenta inner join tabla as tablaproducto on (tablacuenta.product_id = tablacuenta.product_id) group by tablacuenta.product_id order by numclaves
ya me contarás