开发者

MySQL query for one result

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜