按照时间,每天分区
create table test_p(id number,createtime date)
partition by range(createtime) interval(numtodsinterval(1,'day')) store in (users)
(
partition test_p_p1 values less than(to_date('20140110','yyyymmdd'))
);
create index index_test_p_id on test_p(id) local;
create index index_test_p_createtime test_p(createtime) local;
按照数字,200000一个分区
create table test_p(id number,createtime date)
partition by range(id) interval(200000) store in (users)
(
partition test_p_p1 values less than(200000)
);
create index index_test_p_id on test_p(id) local;
create index index_test_p_createtime test_p(createtime) local;
本文介绍如何在Oracle数据库中创建分区表,并为这些表建立局部索引以提高查询效率。具体包括按时间每日分区及按数字每200000个记录分区的方法。
&spm=1001.2101.3001.5002&articleId=88302048&d=1&t=3&u=102bbfe3e6684e3188fc2330b5a14c85)
1673

被折叠的 条评论
为什么被折叠?



