Download Performance Guide for Informix Extended Parallel Server

Transcript
Join Order
Hash joins and other uses of hash functions are effective in balancing
processing or distribution only if the hashed column does not contain many
duplicates. For hash joins, if the join key column contains many duplicates,
one hash partition will contain many more rows than other partitions. This
condition creates one kind of data skew. Performance suffers because the other
coservers must wait for the coserver that is processing the largest hash table.
Join Order
The order in which the database server joins tables in a query is extremely
important. A poor join order can cause poor query performance.
The following section explains how the database server executes a plan
according to a specific join order.
Three-Way Join
Consider the following SELECT statement, which calls for a three-way join:
SELECT C.customer_num, O.order_num
FROM customer C, orders O, items I
WHERE C.customer_num = O.customer_num
AND O.order_num = I.order_num
The optimizer can choose one of the following join orders:
■
Join customer to orders. Join the result to items.
■
Join orders to customer. Join the result to items.
■
Join customer to items. Join the result to orders.
■
Join items to customer. Join the result to orders.
■
Join orders to items. Join the result to customer.
■
Join items to orders. Join the result to customer.
Queries and the Query Optimizer 10-9