oracle11G数据下,通过insert select方式进行批量插入数据,数据量大约为6W条.增加时间索引后,花时间为2秒,无时间索引花费时间大约为23秒.请教一下大家,为什么增加时间索引后,插入速度变快了.
批量插入代码:
INSERT INTO moni_history(id, CONF_ID, data_time,DATA_VALUE)
select sys_guid(), CONF_ID,data_time+1, DATA_VALUE from moni_history t
where t.data_time>=to_date('2020-05-1 00:00:00','yyyy-mm-dd hh24:mi:ss')
and t.data_time<to_date('2020-05-2 00:00:00','yyyy-mm-dd hh24:mi:ss')
时间花费对比:
`