oracle表A中月份列为char(6)类型,按月份字段做了range分区。对该表建立local索引,每个分区对应一个索引,索引占了很大的空间。实际上频繁查询的数据就是近几个月的,我现在只想对'P200909'这一个分区做局部索引,其它分区不索引,可否实现?
oracle中如何只对一个range分区做索引
答案:2 悬赏:80 手机版
解决时间 2021-04-22 13:35
- 提问者网友:做自己de王妃
- 2021-04-21 16:10
最佳答案
- 五星知识达人网友:千杯敬自由
- 2021-04-21 17:13
CREATE TABLE sales_range
(salesman_id NUMBER(5),
salesman_name VARCHAr2(30),
sales_amount NUMBER(10),
sales_date DATE)
PARTITION BY RANGE(sales_date)
(
PARTITION sales_jan2000 VALUES LESS THAN(TO_DATE('02/01/2000','DD/MM/YYYY')),
PARTITION sales_feb2000 VALUES LESS THAN(TO_DATE('03/01/2000','DD/MM/YYYY')),
PARTITION sales_mar2000 VALUES LESS THAN(TO_DATE('04/01/2000','DD/MM/YYYY')),
PARTITION sales_apr2000 VALUES LESS THAN(TO_DATE('05/01/2000','DD/MM/YYYY'))
);
(salesman_id NUMBER(5),
salesman_name VARCHAr2(30),
sales_amount NUMBER(10),
sales_date DATE)
PARTITION BY RANGE(sales_date)
(
PARTITION sales_jan2000 VALUES LESS THAN(TO_DATE('02/01/2000','DD/MM/YYYY')),
PARTITION sales_feb2000 VALUES LESS THAN(TO_DATE('03/01/2000','DD/MM/YYYY')),
PARTITION sales_mar2000 VALUES LESS THAN(TO_DATE('04/01/2000','DD/MM/YYYY')),
PARTITION sales_apr2000 VALUES LESS THAN(TO_DATE('05/01/2000','DD/MM/YYYY'))
);
全部回答
- 1楼网友:迷人又混蛋
- 2021-04-21 18:15
可以..
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯