当前位置: 代码迷 >> Oracle开发 >> 怎么设计数据量大的表,可以提高查询效率
  详细解决方案

怎么设计数据量大的表,可以提高查询效率

热度:106   发布时间:2016-04-24 07:57:15.0
如何设计数据量大的表,可以提高查询效率?
我有一张表(t_table),该表数据量很大,而且逐年增加,每年增加的数据在200万条以上,该结构如下:
Id                                     bigint   NOT   NULL   auto_increment,
Version                           int   NOT   NULL,
Title                             VARCHAR2(100)   not   null,
Content                         VARCHAR2(2000)   not   null,
ClassId                 int   not   null,
STATE                             int   not   null,
CreatorId                       int   not   null,
CreateDate               DATE   not   null,
Degree           int,
ReplayerId                 int   not   null,

对他查询的语句如下:
select   *   from   t_table  
where   state   in   (1,3)   and  
ClassId   =   2   and
CreatorId=12   and  
ReplayerId=13   and  
CreateDate= '2007-01-02 '   and
Degree   =   1

这张表该如何设计,查询效率可以更高。oracle9i,刚开始用oracle,请大家多指教!

------解决方案--------------------
一年两百万条不算多。

重要的是建索引来提高查询效率。
  相关解决方案