我正在从数据库中选择产品列表并将其显示给用户。我已经为 where 子句中使用的列创建了索引,然后返回和加载结果也需要很多时间。
SELECT
prod_disp.pdid, prod_disp.cat_id, prod_disp.title, prod_disp.image_url,
prod_disp.price, prod_stat.eyeing_ids, prod_stat.eyeing_num,
prod_stat.listing_num, prod_stat.reviews_num, prod_stat.reviews_score
FROM
products.prod_disp
INNER JOIN products.prod_stat ON prod_disp.pdid = prod_stat.pdid
WHERE
prod_disp.active='1' AND prod_disp.cat_id='7'
ORDER BY
RAND()
LIMIT 0, 21;