A query I have to amend is currently filtering a timestamp based on an environment variable that is of type date.
i.e.
trunc(insert_timestamp) >= :cob_date + 1
However the index on insert_timestamp is not being used, so I was wondering if I change the filter to the following:
insert_timestamp > to_date(to_char(:cob_date + 1, 'dd/mm/yyyy')|| '23:59:59', 'dd/mm/yyyy hh24:mi:ss')
Would the filter possibly not catch some rows between 23:59:59 and midnight ?
The input date (:cob_date) is of the format dd/mm/yyyy with no time, which I assume time is therefore defaulted to 00:00:00.
insert_timestamp is a timestamp column.
Thanks