|
|
INLS 723 Database Systems II, Fall 2006
|
Oct 30OutlineCardinality of Multiway RelationsBinary Search Trees and B+-TreesElmasri and Navathe Ch. 14 exampleAdditional whiteboard example if time permitsQuery TuningElmasri and Navathe Ch. 15 and Ch. 16 slidesLinks
Examples(based on http://www.dba-oracle.com/art_sql_tune.htm)
EXPLAIN PLAN
start utlxplan // this is an Oracle scriptGenerate 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 |