Techniques are described for performing logical operations, where the
techniques generally involve the use of dynamic flags used as markers to
build a result set in response to a search query. The dynamic flags
within a result set may be guide elements linked to one another, and to
their respective data records and attributes, via pointers. In this case,
the groups of guide elements forming result sets may each also be linked
to one another via pointers, and may each be associated with a counter
for counting a number of guide elements within a corresponding result
set. The dynamic flags also may be individual bits within a bitmap, where
the bitmap is linked to a particular result set identifier via a pointer,
and the individual bitmaps are linked to their corresponding data
record(s) via a relative addressing scheme. In this case, a counter also
may be used to determine a number of hits within a result set (bitmap),
before, during, and after a particular logical operation.