Databases Reference
In-Depth Information
In the last query, in step 8, you can observe a similar behavior. The FTS operation is replaced
by an Index Fast Full Scan. The output is as follows:
There's more...
If we add an ORDER BY clause in the DISTINCT and GROUP BY queries, there is a change
in the execution plans. The queries will change as follows:
SELECT
DISTINCT CUST_CITY
FROM CUSTOMERS
ORDER BY CUST_CITY;
SELECT CUST_CITY, COUNT(*)
FROM CUSTOMERS
GROUP BY CUST_CITY
ORDER BY CUST_CITY;
 
Search WWH ::




Custom Search