I have the below SQL Query getting data from View, the View has almost 175,000 record.
The query needs to filter on some parameters before get the data, but it takes very long time to execute.
Where I make the mistake, could you please help me.
This is the query code:
select
[Col1]
,[Col2]
,[Col3]
,[Col4]
,[Col5]
,[Col6]
,[Col7]
,[Col8]
,[Col9]
,[Col10]
,[Col11]
,[Col12]
,[Col13]
,[Col14]
,[Col15]
,[Col16]
,[Col17]
,[Col18]
,[Col19]
from Tabel_1
where (
(([Col1] = IsNull(@Col1, [Col1])) or ([Col1] is null))
and (([Col2] = IsNull(@Col2, [Col2])) or ([Col2] is null))
and (([Col3] = IsNull(@Col3, [Col3])) or ([Col3] is null))
and (([Col4] = IsNull(@Col4, [Col4])) or ([Col4] is null))
and (([Col5] = IsNull(@Col5, [Col5])) or ([Col5] is null))
and (([Col6] = IsNull(@Col6, [Col6])) or ([Col6] is null))
and (([Col7] = IsNull(@Col7, [Col7])) or ([Col7] is null))
and (([Col8] = IsNull(@Col8, [Col8])) or ([Col8] is null))
and (([Col9] = IsNull(@Col9, [Col9])) or ([Col9] is null))
and (([Col10] = IsNull(@Col10, [Col10])) or ([Col10] is null))
and (([Col11] = IsNull(@Col11, [Col11])) or ([Col11] is null))
and (([Col12] = IsNull(@Col12, [Col12])) or ([Col12] is null))
and (([Col13] = IsNull(@Col13, [Col13])) or ([Col13] is null))
and (([Col14] = IsNull(@Col14, [Col14])) or ([Col14] is null))
and (([Col15] = IsNull(@Col15, [Col15])) or ([Col15] is null))
)