Evaluate Grouped ONCE-UNIQUE AGGREGATE.
Evaluate Ungrouped ONCE-UNIQUE AGGREGATE.
When the subquery includes distinct, the ONCE-UNIQUE aggregate indicates that duplicates are being eliminated:
select pub_name from publishers where pub_id = (select distinct titles.pub_id from titles where publishers.pub_id = titles.pub_id and price > $1000)
QUERY PLAN FOR STATEMENT 1 (at line 1). STEP 1 The type of query is SELECT. FROM TABLE publishers Nested iteration. Table Scan. Forward scan. Positioning at start of table. Run subquery 1 (at nesting level 1). Using I/O Size 2 Kbytes for data pages. With LRU Buffer Replacement Strategy for data pages. NESTING LEVEL 1 SUBQUERIES FOR STATEMENT 1. QUERY PLAN FOR SUBQUERY 1 (at nesting level 1 and at line 3). Correlated Subquery. Subquery under an EXPRESSION predicate. STEP 1 The type of query is SELECT. Evaluate Ungrouped ONCE-UNIQUE AGGREGATE. FROM TABLE titles Nested iteration. Index : pub_id_ix Forward scan. Positioning by key. Keys are: pub_id ASC Using I/O Size 16 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. END OF QUERY PLAN FOR SUBQUERY 1.