Progress
Database Design
Guide


Bracketing

Having selected one or more indexes to satisfy a query, Progress tries immediately to isolate the smallest necessary index subset, so as to return as few records as possible. This is called bracketing. Careful query design can increase the opportunities for bracketing, thereby preventing Progress from scanning entire indexes and examining all records. The rules for bracketing are simple:

The following table provides some bracketing examples:

Sample WHERE Clause
Indexes Used
Brackets
WHERE Contact = "DLC" 
 AND (Sales-Rep BEGINS "S"
   OR Sales-Rep BEGINS "B") 
Cust-Num
None
WHERE Postal-Code >= "01000" 
 AND City = "Boston" 
Cust-Num
None
WHERE Name = "Harrison" 
 AND Sales-Rep BEGINS "S"  
Name
Name
WHERE Contact = "DLC" 
 AND Sales-Rep BEGINS "S"  
Sales-Rep
Sales-Rep
WHERE Country BEGINS "EC"
 AND Sales-Rep BEGINS "S"
 BY Country  
Country-Post
Country-Post
WHERE Comments CONTAINS "big"   
AND Country = "USA" 
 AND Postal-Code = "01730"   
Comments
Country-Post
Country
Postal-Code

The following recommendations are intended to help you maximize query performance. They are only recommendations, and you may choose to ignore one or more of them in specific circumstances.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095