I have a scenario where there is a table names SESSIONEVENT.
The query is
SELECT * FROM SESSIONEVENT WHERE (EVENTTYPE=:1 OR EVENTTYPE=:2 OR EVENTTYPE =:3) AND TIMESTAMP0 < :4;
It uses values 102,103,104 & 3494858732085 respectively.
There is Frequency based histogram on EVENTTYPE column and Height Based on TIMESTAMP0 column.
The query when used with literals run fine with optimal plan using index on EVENTTYPE column
When the query uses bind variables, it runs very slow taking suboptimal plan using index on TIMESTAMP0 column.
We have set hidden parameter "_optim_peek_user_binds"=false at database level.
When setting this parameter to true, the query runs fine. But we don't want to set it to true for just one sql since all the other sqls are running fine.
Can anyone let me know the solution for this issue?
Thanks in Advance.
You can also get information regarding SAP Oracle.