开发者

MySQL query for one result

开发者 https://www.devze.com 2023-02-19 18:23 出处:网络
Pretty straightforward question: is it more efficient to query a database table and sea开发者_Go百科rch potentially tens of thousands of entries for the one matching result, or create another new tabl

Pretty straightforward question: is it more efficient to query a database table and sea开发者_Go百科rch potentially tens of thousands of entries for the one matching result, or create another new table for that 1 result?

SELECT n FROM x WHERE b = 1 OR SELECT * from y?


If you have your field b indexed and its cardinality is high - then first query will be enough efficient.

0

精彩评论

暂无评论...
验证码 换一张
取 消