数据库是 oracle 9i表是这样的分区表(记录有千万条)create table text (rq1 date,rq2 date,b varcahr2(20))
partition by range (rq1)
(partition par_jf01 values less than (to_date('200001','yyyymm')) tablespace p_j01_ts,
partition par_jf02 values less than (to_date('200501','yyyymm')) tablespace p_j02_ts,
partition par_jf03 values less than (maxvalue) tablespace p_j03_ts
);索引
create index i_text_rq1 on text(rq1) local
(partition par_jf01 tablespace i_j01_ts,
partition par_jf02 tablespace i_j02_ts,
partition par_jf03 tablespace i_j03_ts
);
create index i_text_rq2 on text(rq2) local
(partition par_jf01 tablespace i_j01_ts,
partition par_jf02 tablespace i_j02_ts,
partition par_jf03 tablespace i_j03_ts
);现在这样查询
select * from text where b='d' order by rq1;
查询速度非常慢,像死机了一样,
但
select * from text where b='d' order by rq2;
就很快
请问这是为什么?
partition by range (rq1)
(partition par_jf01 values less than (to_date('200001','yyyymm')) tablespace p_j01_ts,
partition par_jf02 values less than (to_date('200501','yyyymm')) tablespace p_j02_ts,
partition par_jf03 values less than (maxvalue) tablespace p_j03_ts
);索引
create index i_text_rq1 on text(rq1) local
(partition par_jf01 tablespace i_j01_ts,
partition par_jf02 tablespace i_j02_ts,
partition par_jf03 tablespace i_j03_ts
);
create index i_text_rq2 on text(rq2) local
(partition par_jf01 tablespace i_j01_ts,
partition par_jf02 tablespace i_j02_ts,
partition par_jf03 tablespace i_j03_ts
);现在这样查询
select * from text where b='d' order by rq1;
查询速度非常慢,像死机了一样,
但
select * from text where b='d' order by rq2;
就很快
请问这是为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货