Why is Oracle so slow when I pass a java.sql.Timestamp for a DATE column?

前端 未结 4 1877
梦如初夏
梦如初夏 2020-12-15 01:15

I have a table with a DATE column with time (as usual in Oracle since there isn\'t a TIME type). When I query that column from JDBC, I have two opt

4条回答
  •  独厮守ぢ
    2020-12-15 02:03

    This is because TIMESTAMP datatype is more accurate than DATE so when you supply TIMESTAMP parameter value into DATE column condition, Oracle has to convert all DATE values into TIMESTAMP to make a comparison (this is the INTERNAL_FUNCTION usage above) and therefore index has to be full scanned.

提交回复
热议问题