In order to illustrate how PMaps are used for query evaluation, consider the query
used earlier:
SELECT * FROM Inventory WHERE status = ???shipped??? AND product-category = ???5???
The query processor determines the pmask, which is obtained by setting the bits
corresponding to the properties covering the query predicates to 1 (status and product-
category) and setting all other bits to 0 (quantity), yielding the pmask 001111
in this case. The pfilter is obtained by setting all bits corresponding to properties
covering the query predicate to the desired value, and setting all other bits to 0.
The pfilter here is 001001, since the queried product-category value is equal to 5
(property value 100) and status value is equal to ???shipped??? (property value 1.) The
tuples for which the filter formula ???pstring AND pmask = pfilter??? is TRUE are in
the result set. For tuple 2 in Table 6, the filter formula evaluates to TRUE since the
pstring (001001) ANDed with 001111 (pmask) is equal to 001001 (pfilter). Since
no other tuple in this example satisfies the filter formula, only tuple 2 is in the result
set. To answer a range query such as ???product-category > 5,??? the equals sign in the
filter formula is changed to greater than.
Tuple.ID (qty,.prod-cat,.status) Property.1 Property.2 Property.3 pstring
1 (49, 2, s) 01 001 1 010011
2 (24, 5, s) 00 100 1 001001
3 (52, 4, s) 11 011 1 110111
4 (37, 1, b) 01 000 0 010000
5 (28, 3, s) 00 010 1 000101
Table 6.
Pages:
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369