测试表
craete table tbl_c(id number, name varchar2(1), insert_time date);
create index idx_tbl_c on tbl_c(insert_time);
模拟数据量,tbl_c初始1300万数据,每天50万。
SQL> select trunc(insert_time), count(*) from tbl_c group by trunc(insert_time) order by trunc(insert_time) desc;
TRUNC(INS COUNT(*)
--------- ----------
06-MAY-17 500000
05-MAY-17 500000
04-MAY-17 500000
03-MAY-17 500000
02-MAY-17 500000
01-MAY-17 500000
30-APR-17 500000
29-APR-17 500000
28-APR-17 500000
27-APR-17 500000
26-APR-17 500000
25-APR-17 500000
24-APR-17 500000
23-APR-17 500000
22-APR-17 500000
21-APR-17 500000
20-APR-17 500000
19-APR-17 500000
18-APR-17 500000
17-APR-17