【发布时间】:2011-10-28 16:46:39
【问题描述】:
我有一个按日期(按天)分区的表和字段(包括日期字段)的本地索引。如果我进行查询:
SELECT * FROM table t WHERE t.fdate = '30.06.2011'
很快就完成了,但是当我完成时
SELECT * FROM table t WHERE EXTRACT(month from t.fdate) = 6 AND EXTRACT(t.fdate 的年份) = 2011
大约需要 200 秒。
如何优化这个查询?我可能需要在 EXTRACT(month from date) AND EXTRACT(year from date) 上创建本地索引吗?
【问题讨论】:
标签: performance oracle oracle10g partitioning date-arithmetic