Patent ID: 7840554

Claim:
A computer based method to simultaneously evaluate conjunctions of range and equality predicates on k fields of a record, said method implemented in computer readable program code stored in computer storage, said method comprising the steps of: (a) computing B 1 =S 1 −C for said k fields, wherein C is a constant whole number and said k fields being either F 1 , F 2 , . . . F k : F 1 ≦L 1 and F 2 ≦L 2 and F k ≦L k , or F 1 , F 2 , . . . F k : F 1 ≧L 1 and F 2 ≧L 2 and F k ≧L k , said L 1 , L 2 . . . L k representing values and said k fields F 1 , F 2 , . . . F k being at offsets [S 1 , E 1 ], [S 2 , E 2 ] . . . [S k , E k ] within said record, wherein offset [X, Y] represents bits X through Y; (b) constructing a mask to extract values of k bits B 1 , B 2 , . . . , B k , said mask comprising a bit vector M having 1s in bits at k bit positions, B 1 , B 2 , B k having 0s in remainder of bits; (c) constructing a value vector containing said values of said k fields F 1 , F 2 , . . . F k , said value vector comprising a bit vector V having said values L 1 , L 2 . . . L k at bit positions [S 1 , E 1 ], [S 2 , E 2 ] . . . [S k , E k ], respectively, and having 0s in remainder of bits; (d) for each record, R, on which said predicates need to be applied, evaluating as part of constant-time query processing as follows: when F 1 , F 2 , . . . F k : F 1 ≦L 1 and F 2 ≦L 2 and F k ≦L k , evaluating ((V−R) AND M)=(V XOR R) AND M), or when F 1 , F 2 , . . . F k : F 1 ≧L 1 and F 2 ≦L 2 and F k ≦L k evaluating ((R−V) AND M)=(V XOR R) AND M), wherein said AND operator represents bit-wise AND of two bit vectors and said XOR operator represents bit-wise Exclusive OR of two bit vectors; and (e) outputting results of said evaluation operation in (d).