I have a table with a InTime and an OutTime column.
Normally when I insert data into this table I set the InTime to a DateTime and the OutTime to null. When the data is removed a OutTime value is set.
When I’m getting data out for a particular time I use something like:
where InTime < sometime and OutTime is > sometime or OutTime is null
My question is, in terms of getting better query / index performance should I be putting some value into OutTime like the max datetime and make the field not nullable?
Then my query becomes
where InTime < sometime and OutTime is > sometime