Rule Based Optimizer   «Prev  Next»

Positioning Statements in FROM clause - Exercise

Change order of Tables in FROM clause

Objective: Sequence table names in the FROM clause.

Exercise scoring

This exercise is worth a total of 10 points. To receive full credit, you will need to respond to two questions regarding items in the FROM clause. Once you have completed your answers, submit it.

Background

Here is a query that joins two tables: the customer table and the order table.
SELECT Customer_name, Order_number 
FROM Customer, order 
WHERE Customer_region = ‘EAST’ ;

Your job as DBA is to tune this query to ensure that the proper driving table is used for the rule-based optimizer.
Here are the table statistics that you have gathered:
  1. There are 100,000 rows in the order table.
  2. There are 500,000 rows in the customer table.
  3. There are 50,000 customers in the EAST region.
  4. There are 20,000 order rows for customers in the EAST region.

Instructions

For this exercise, you need to perform the following tasks:
  1. State the condition that is used to identify the driving table.
  2. State the proper driving table, and where it should be placed in the FROM clause.

Submitting your exercise

Enter your queries in the two text boxes below and click Submit to submit your responses.
Remember, you must fill in both text boxes before clicking the Submit button.