METHOD AND DATA PROCESSING SYSTEM FOR DETECTING PATTERNS IN SQL TO ALLOW OPTIMIZED USE OF MULTI-COLUMN INDEXES
A database management optimizer for efficient use of multi-column indexes for a query. The optimizer converts WHERE clauses conditions to a CNF list (102), extracts conditions used to access a current table (104), checks whether more tables indexes are to be examined (106), gathers key conditions into an OR-GROUP vs KEY COLUMN two-dimension matrix (108), checks for multi-column index range conditions as one or two-sided pattern (110), saves best access method found (112). If no more indexes remain to be examined, a test is made whether this pattern access method is superior (114), if this pattern acces method is superior, a composite kay value is built and a multi-column index is accessed using range condition compare operator (116). Added restrictions are applied to produce correct results for the query (118). If the pattern access method is not superior, the best access method of the methods found is applied (120).