好像曾经听别人说过:子查询的性能比连接的性能要低。
大侠们说对吗?
我个人认为不一定。如:
select a.* from a where a.id=(select b.nid from b where b.name='Jack')
select a.* from a join b on a.id=b.nid where b.name='Jack'我认为:
如果a表很大,b表很小,那么子查询的那个性能是要比连接的要高的;
如果a表和b表都很大的话,那么连接的性能要高。请问我的意见对吗?
大侠们说对吗?
我个人认为不一定。如:
select a.* from a where a.id=(select b.nid from b where b.name='Jack')
select a.* from a join b on a.id=b.nid where b.name='Jack'我认为:
如果a表很大,b表很小,那么子查询的那个性能是要比连接的要高的;
如果a表和b表都很大的话,那么连接的性能要高。请问我的意见对吗?
哇,这么晚了版主还在回答问题啊,敬佩。
不过,这个问题你应该有确切的答案啊.
很难说哪个比哪个好查想知道,可以比较它们的执行计划
执行计划是个什么东西啊?