6.在WHERE 语句中,尽量避免对索引字段进行计算操作                这个常识相信绝大部分开发人员都应该知道,但仍有不少人这么使用,我想其中一个最主要的原因可能是为了编写方便吧,但如果仅为了编                写简单而损害了性能,那就不可取了                9月份在对XX系统做性能分析时发现,有大量的后台程序存在类似用法,如:                ......                where trunc(create_date)=trunc(:date1)                虽然已对create_date 字段建了索引,但由于加了TRUNC,使得索引无法用上。此处正确的写法应该是                where create_date>=trunc(:date1) and create_date<trunc(:date1)+1                或者是                where create_date between trunc(:date1) and trunc(:date1)+1-1/(24*60*60)                注意:因between 的范围是个闭区间(greater than or equal to low value and less than or equal to high value.),                故严格意义上应该再减去一个趋于0的小数,这里暂且设置成减去1秒(1/(24*60*60)),如果不要求这么精确的话,可以略掉这步