SELECT COUNT(*) AS count_all, products.id AS products_id
FROM `products`
INNER JOIN `product_device_facilities`
ON `product_device_facilities`.`product_id` = `products`.`id`
INNER JOIN `product_vendors`
ON `product_vendors`.`ProductId` = `products`.`id`
INNER JOIN `screen_shots`
ON `screen_shots`.`ProductVendorId` = `product_vendors`.`id`
WHERE ((DownloadCount >= 10 or DownloadCount is NULL)
and (Minsdk <= 10 or Minsdk is null))
GROUP BY products.id
HAVING GROUP_CONCAT(device_facility_id ORDER BY device_facility_id ASC) IN (0)
這需要10秒才能完成1個拉赫(100k - > 10 Lakh = 100萬)的記錄。MySQL需要10秒才能計算出100k條記錄的條件
請幫我提高性能。
什麼是表引擎? InnoDB的?發佈您的查詢「解釋」聲明。 – Vadim
(請記住,不是所有我們知道山一十萬是什麼。) –
10萬盧比=百萬 – manurajhada