without add this statement below
AND (c.PLID is null OR fmat.Value=c.PLID)
query take 3 minute to display 900 rows and after add
AND (c.PLID is null OR fmat.Value=c.PLID)
it take 9 minutes
Are there are any way to make query above to be optional without take too much time
PLID IS optional if it have value then get his value and code type
if PLID not have value then select data based on code type
so why it take too much time