FROM TABLE tablename [ correlation_name ]
This message indicates which table the query is reading from. The “FROM TABLE” message is followed on the next line by the table name. If the from clause includes correlation names for tables, these are printed after the table names. When queries create and use worktables, the “FROM TABLE” prints the name of the worktable.
When your query joins one or more tables, the order of “FROM TABLE” messages in the output shows you the order in which the query plan chosen by the optimizer joins the tables. This query displays the join order in a three-table join:
select a.au_id, au_fname, au_lname from titles t, titleauthor ta, authors a where a.au_id = ta.au_id and ta.title_id = t.title_id and au_lname = "Bloom"
QUERY PLAN FOR STATEMENT 1 (at line 1). STEP 1 The type of query is SELECT. FROM TABLE authors a Nested iteration. Index : au_lname_ix Forward scan. Positioning by key. Keys are: au_lname ASC Using I/O Size 2 Kbytes for index leaf pages. With LRU Buffer Replacement Strategy for index leaf pages. Using I/O Size 2 Kbytes for data pages. With LRU Buffer Replacement Strategy for data pages. FROM TABLE titleauthor ta Nested iteration. Index : at_ix Forward scan. Positioning by key. Index contains all needed columns. Base table will not be read. Keys are: au_id ASC Using I/O Size 2 Kbytes for index leaf pages. With LRU Buffer Replacement Strategy for index leaf pages. FROM TABLE titles t Nested iteration. Using Clustered Index. Index : title_id_ix Forward scan. Positioning by key. Index contains all needed columns. Base table will not be read. Keys are: title_id ASC Using I/O Size 2 Kbytes for index leaf pages. With LRU Buffer Replacement Strategy for index leaf pages.
The sequence of tables in this output shows the order chosen by the query optimizer, which is not the order in which they were listed in the from clause or where clause:
First, the qualifying rows from the authors table are located (using the search clause on au_lname).
Then, those rows are joined with the titleauthor table (using the join clause on the au_id columns).
Finally, the titles table is joined with the titleauthor table to retrieve the desired columns (using the join clause on the title_id columns).