求助db2连表查询的效率问题。
老格 2008-05-06 11:48:07 有下面三条sql ,其中 table1 有100万数据量,table2 有1000万数据量
1、
select b.age ,
a.pay from table1 a, table2 b
where a.IDno=b.IDno
2、
select * from table1 a, table2 b
where a.IDno=b.IDno
3、
select
a.pay from table1 a, table2 b
where a.IDno=b.IDno
不知道为什么在db2中第二,三条sql都比第一条快得很多。
但是orcale三者差不多。
本人需要的是第一条。客户需要一个报表。希望哪位大侠能提供点好建议。
小弟在此先谢谢了。