If the value of @param is null, which is better to use:
WHERE t.column = COALESCE(@param, '')WHERE t.column = IFNULL(@param, '')WHERE (@param IS NULL OR t.column = @param)
Is the OR more expensive than comparing the column to a value that will return all values for the specified column? My understanding is that options 1 & 2 will force a full table scan every time, while #3 would not.
3 is best because the optimizer will short-circuit that evaluation during the optimizer stage and eliminate the where clause.