Forum Discussion
aarifshah
Apr 08, 2024Copper Contributor
Improve query performance
I have a stored procedure. It returns search results from involved join tables. One of the filter parameter is @vendorId.And, It has been used here : AND (@vendorIdParam IS NULL OR v.VendorId = @ven...
olafhelper
Apr 09, 2024Bronze Contributor
AND (@vendorIdParam IS NULL OR ...
It's an optional parameter, if you pass nothing (NULL) and it should not filter anything.
But with that less on information it is impossible to say, why it becomes slow.
Check the execution plan of the SP.