I have a view, when I request this view, it is slow. However, if I remove the NVL function, it works quickly.
I checked the execution plan when using the NVL function, it does not use any index. If the NVL function is not used, this is the index. I tried to specify the index as a hint, but that did not help. Not sure if the tooltip is being considered at runtime.
Below is the view and query used to create the view.
CREATE OR REPLACE FORCE VIEW "test"(a,b)
select NVL(table1.a,table2.a) a,table2.b from table1 join table2 on table1.id=table2.id
The query that I use in the view,
select * from test where a='XYZ'
Any thoughts what I should do to fulfill the request above?
09999 source
share