Article ID: 156551
Article Last Modified on 2/12/2007
? SYS(3054,1)
SELECT * FROM customer WHERE customer.country = 'USA'
The following is returned:
Rushmore optimization level for table customer: none
INDEX on country TAG country
NOTE: Be sure to re-select the customer table first (SELECT customer) so
you are operating on the original data. Now, you should see the
following:
Using index tag Country to rushmore optimize table customer
Rushmore optimization level for table customer: full
SELECT * FROM customer WHERE customer.country = 'USA' and ;
customer.maxordamt>2000
You see the following:
Using index tag Country to rushmore optimize table customer
Rushmore optimization level for table customer: partial
Adding a tag on maxordamt makes the second query fully optimizable.
SELECT * FROM customer, orders WHERE ;
customer.cust_id = orders.cust_id
You see the following:
Rushmore optimization level for table customer: none
Rushmore optimization level for table orders: none
SELECT customer
INDEX ON cust_id TAG cust_id
SELECT orders
INDEX ON cust_id TAG cust_id
Try the query again:
SELECT * FROM customer, orders WHERE ;
customer.cust_id = orders.cust_id
You see the following:
Rushmore optimization level for table customer: none
Rushmore optimization level for table orders: none
Since the query is joining the tables and not doing any filtering, this
is correct. Since there is no filter, there is no filter optimization.
? SYS(3054,11)
Try the query again and you see the following:
Rushmore optimization level for table customer: none
Rushmore optimization level for table orders: none
Joining table customer and table orders using index tag Cust_id
SELECT * FROM customer, orders WHERE customer.cust_id=orders.cust_id ;
AND customer.country = 'USA' AND orders.order_amt>500
You see the following:
Rushmore optimization level for table customer: full
Rushmore optimization level for table orders: none
Joining table customer and table orders using index tag Cust_id
Since there is no tag for orders.order_amt, that filter expression
cannot be optimized. Add a tag to orders for the order_amt field and the
optimization for orders is full.Additional query words: query performance
Keywords: kbperformance kbfont kbhowto kbprint KB156551