1、你的视图改为:
create view v_t
as select a1,a2,a3 from t1
union all
select a1,a2,a3 from t2
union all
select a1,a2,a3 from t3
union all
select a1,a2,a3 from t4
create view v_t
as select a1,a2,a3 from t1
union all
select a1,a2,a3 from t2
union all
select a1,a2,a3 from t3
union all
select a1,a2,a3 from t4
union all比union快很多,应为union 需要在聚合的时候检查是否有重复的!二union all就不需要!
应为sql都是扫描主键 分区列
2、
一定要!
3、是呀!
这里是原来我答过的贴,你看看,实践一下就知道了!
http://expert.csdn.net/Expert/topic/1655/1655343.xml?temp=.7236902
http://expert.csdn.net/Expert/topic/1606/1606762.xml?temp=.9268762