gpt4 book ai didi

Mysql 或性能问题

转载 作者:行者123 更新时间:2023-11-29 06:21:01 25 4
gpt4 key购买 nike

<分区>

我在 mysql 查询中使用 OR 同时检查不同的值,我发现结果来得很慢,这里我也加入了两个表,我无法检查哪个花费的时间长时间。

在这里查询:

select l.*, l.category as lid
FROM listings AS l
LEFT JOIN listprices as pr ON pr.product_id=l.id
where (pr.price >= 100 AND pr.price <= 1000)
OR (pr.price >= 1001 AND pr.price <= 5000)
OR (pr.price >= 5001 AND pr.price <= 10000)
order by pr.price ASC

查询工作正常,但结果花费了太多时间。如果有任何其他选择可以快速获得。我听说 OR 花了很多时间来执行结果。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com