> Sometimes records
> from this table have to be deleted and my customer wants
> that these are not physically deleted, but only marked
> as 'deleted'.
> Of course this means that the where clause of many queries
> have to be modified:
> SELECT x FROM Y WHERE IsDeleted = 'N'.
Creating a view that only 'shows' non-deleted records would be easier than
updating all you queries. It would be even easier if you could rename the
table, and create the view with the same name as the 'origional' table, then
you would not have to change any queries.
> I am wondering what is more expensive for the engine: to
> scan the whole table or work with an index on the IsDeleted
Don't index 'boolean' fields
11:36am up 43 days, 17:26, 1 user, load average: 0.12, 0.04, 0.01