INLS 723 Database Systems II, Fall 2006
INLS 723

Main Page

Announcements

Calendar/Notes

Assignments

DB Links

Course Policies

Grades

Oct 30

Outline

Cardinality of Multiway Relations

Binary Search Trees and B+-Trees

Elmasri and Navathe Ch. 14 example

Additional whiteboard example if time permits

Query Tuning

Elmasri and Navathe Ch. 15 and Ch. 16 slides

Links

Examples

(based on http://www.dba-oracle.com/art_sql_tune.htm)

EXPLAIN PLAN
Set up the plan_table to store the plan

start utlxplan    // this is an Oracle script
Generate the plan, but don't run the query
EXPLAIN PLAN 
INTO plan_table
FOR
<select statement goes here>
One query with a standard join
SELECT sname 
FROM sailors s, reserves r
WHERE s.sid = r.sid AND r.bid = 101;
Same results with a nested query
SELECT sname
FROM sailors s
WHERE s.sid IN (SELECT r.sid
		FROM reserves r
		WHERE r.bid = 101);
Look at the plan
SELECT operation, SUBSTR(options,1,30), object_name, position
FROM plan_table;
More details

SQL Query Tuning Links