page80
62
Then run the same simple query accessing
dt_supplier_part
as shown earlier to
generate a query profile.
SELECT part_name,
available_quantity AS avail_qty,
unit_price,
supplier_account_balance AS acct_bal,
supplier_name
FROM dt_supplier_part
ORDER BY part_name ASC,
unit_price DESC
LIMIT 10;
Figure 3-10 shows the reduction in query duration from 10 seconds down to 4
seconds.
Figure 3-10.
Sample query refactored for dynamic table
As you should expect, the query profile now references a single object, the new
dynamic table
dt_supplier_part
, as shown in Figure 3-11.
ChapTer 3
The Query profiler