公司有一交易表,里面现在大概有3E+数据了。我想取一年的交易要在这3E条数据里面找,我会把其中我们部门的那部分数据插到我自己电脑上,计算每种交易产生的次数,和交易总量,count(),sum()请问有什么建议,谢谢。

解决方案 »

  1.   

    3亿还不分区?
    统计参考物化视图 
    http://blog.csdn.net/suncrafted/archive/2009/06/26/4300358.aspx
    http://topic.csdn.net/u/20091225/14/e225f4f6-03f6-4684-b82b-45d58e045ad5.html?seed=2012731555&r=62218282#r_62218282
      

  2.   

    如果有index的話也不會很慢的!!可以貼出你的執行計劃!
      

  3.   

    I think reate snapshot is not a bad choice.
    Create index on major columns which you want to select from.
    And then use this index select data and create a snapshot.
    So the snapshot performs a temp table for you to handle these data.
    If the the data is as your estimate about 1 million,it's a better choice
    to tackle these data in a snapshot rather than in the base table.
      

  4.   

    我知道的一点
    1.用集合。
    2.函数传参用NOCOPY bint。