避免在等号左边使用to_char、to_date.
例:
select * from table where to_char(date, 'yyyy-mm-dd') = '2017-05-18'
可改为
select * from table where date >= '207-05-18 00:00:00' and date <= '207-05-18 23:59:59'
你会看到耗时会减少很多
避免在等号左边使用to_char、to_date.
例:
select * from table where to_char(date, 'yyyy-mm-dd') = '2017-05-18'
可改为
select * from table where date >= '207-05-18 00:00:00' and date <= '207-05-18 23:59:59'
你会看到耗时会减少很多