Pro Oracle SQL by unknow

Pro Oracle SQL by unknow

Author:unknow
Language: eng
Format: epub
Tags: Computers, Programming Languages, Sql, Databases, General
ISBN: 9781430262206
Google: nrwu-f4JwjcC
Publisher: Apress
Published: 2010-12-15T05:00:00+00:00


Testing Execution Plans

When examining the execution plans for subfactored queries, it may not be readily apparent whether Oracle is choosing the best execution plan. It may seem that the use of the INLINE or MATERIALIZE 1 hint would result in better performing SQL. In some cases it may, but the use of these hints needs to be tested and considered in the context of overall application performance.

The need to test for optimum query performance can be illustrated by a report that management has requested. The report must show the distribution of customers by country and income level, showing only those countries and income levels that make up 1 percent or more of the entire customer base. A country and income level should also be reported if the number of customers in an income level bracket is greater than or equal to 25 percent of all customers in that income bracket. 2

The query in Listing 10-4 is the end result. 3 The cust factored subquery has been retained from previous queries. New are the subqueries in the HAVING clause; these are used to enforce the rules stipulated for the report.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.