Patent ID: 8214411

Claim:
A method, comprising: maintaining, by a device and in a database, a plurality of data items, each data item of the plurality of data items being associated with a respective category; associating, by the device and in the database, a first counter value with each data item, the first counter value indicating a number of times the respective category has been deleted from the database at a time when the data item was stored in the database; associating, by the device and in the database or another database, a second counter value with the respective category, the second counter value indicating a current value for a number of times the respective category has been deleted from the database; comparing, by the device, the first counter value with the second counter value to produce a first comparison, the comparing further including: determining if the second counter value is less than or equal to the first counter value; performing, by the device and based on the first comparison, selective retrieving and returning the requested data item or hiding the requested data item for garbage collection, the performing including one of: retrieving and returning the requested data item if the second counter value is less than or equal to the first counter value, or designating the requested data item for garbage collection, without retrieving and returning the data item, if the second counter value is greater than the first counter value; and selectively deleting, by the device and from the database, one or more of the data items, of the plurality of data items, from the database based on the first counter values and the second counter value.