Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
No argument from me!
I particularly like the datetime idea. Useful in the majority of cases I can think of.
Hope all is well with you
Jim
>Hiya Jim!
>
>Filtering PK's for deleted()ness is only necessary when the PK is meaningful. Since the possibility exists that the user will create another record with the same PK as a deleted record. If its a generated number that will not be repeated until a pack is done, there should not be a deleted filter on the tag. Example: Number generator resets at 4 billion, so it will take a huge number of records before a duplicate key is generated. If all the records will eventually be deleted by the time number 1 is generated again, there will never be a duplicate.
>
>In the case of the originator of this thread, he has many deleted records, so the deleted tag makes sense. If his PK's are generated, he shouldn't filter the tags on deleted.
>
>I'd prefer to use a datetime field for his deleted records in this case, so I could look at "deleted" records in the last week or the last 24 hours etc. In that case, I'd definitely have an index tag on that datetime field. He'd have to filter these out of all other queries, but that would also permit archiving off records that were deleted a year ago while leaving the other deleted records alone.
>
>HTH
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only