MAXTAG and note selection

For a delete notes request, you can also specify the MAXTAG keyword to control which notes are to be selected. Conceptually, XCF first uses the selection criteria to create a collection of notes, and then removes any notes whose tag value is greater than the indicated MAXTAG value. That is, if SET1 is the collection of notes identified by the selection criteria, and SET2 is the collection of notes whose tag value is less than or equal to the indicated MAXTAG value, then the set of notes to be deleted is the intersection of those two sets.

For example, suppose the note tag values are timestamps and the application uses a timestamp to track periodic checkpoints of its data. The application might need to delete all notes in the note pad that had tag values older than a given checkpoint timestamp (call it ckpttod). To do so, it could issue a delete notes request with tag range criteria of MINTAG=0 and MAXTAG=ckpttod. Alternatively, it could issue a delete notes request that selected all notes in the note pad and specify MAXTAG=ckpttod to limit the delete to those notes that have a tag value less than or equal to the checkpoint timestamp.

As another example, suppose again that note tag values are timestamps and that the application has a checkpoint timestamp ckpttod. The application might need to delete all notes written by a given connection prior to the checkpoint timestamp. To do so, it could issue a delete notes request with MAXTAG=ckpttod and connection identifier selection criteria that included all notes (both persistent and nonpersistent) associated with the desired connection. The delete notes request would select all notes associated with the indicated connection that had tag values less than or equal to the checkpoint time stamp.