Otimize query for products.