I have a table with a column named DeleteCode which has the following values and their meanings:
NULL = Active record not yet processed
0 = Active record already processed
R = Deleted by Rescheduling
M = Deleted by Modification
C = Deleted by Cancellation
N = Deleted by No Show
So I have the following options whenever I want to query the active records in this table:
(1) SELECT * FROM MyTable WHERE IsNull(DeleteCode,'0') = '0'
(2) SELECT * FROM MyTable WHERE DeleteCode IS NULL OR DeleteCode = '0'
Which of the above would perform faster?
Also, would it be worthwhile to create an index on the DeleteCode column or is it not necessary since the possible values of DeleteCode are only very few?
Thanks in advance for your much appreciated help!