This content has been marked as final. Show 4 replies
That WHERE clause is needlessly complicated. Why not just say:
That won't solve the efficiency problem; Oracle isn't good with OR conditions.
... WHERE k.id_kontr = :b2 OR ( :b2 IS NULL AND k.cif_profile = :b1 )
Could you have 2 sepearate queries: one for when :b2 is NULL, and another for when :b2 is not NULL? The 2 queries would be identical except for the WHERE clause. Test :b2 first, and then run the appropriate query.