Re: Hints

From: Robert Hanuschke <robert.hanuschke_at_googlemail.com>
Date: Mon, 15 Aug 2011 09:37:43 +0200
Message-ID: <CAL6WDh0ZE3GLiUBP6G9WzgtVQSufZTpdCFeRu7OjqUj+rzQETQ_at_mail.gmail.com>



Hi,

The first sentences of the Oracle documentation (performance tuning guide) regarding hints explain the pros and cons pretty well, I think:

"Hints let you make decisions usually made by the optimizer. As an application designer, you might know information about your data that the optimizer does not know. Hints provide a mechanism to instruct the optimizer to choose a certain query execution plan based on the specific criteria.

For example, you might know that a certain index is more selective for certain queries. Based on this information, you might be able to choose a more efficient execution plan than the optimizer. In such a case, use hints to instruct the optimizer to use the optimal execution plan.

Note:
The use of hints involves extra code that must be managed, checked, and controlled."
(http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/hintsref.htm)

There are good reasons to use hints if you've got data/situations of which the optimizer will likely not be aware (e.g. because of statistics only being estimated and missing some details because of that) but on the downside you have to maintain them.

Best regards,
Robert

On Mon, Aug 15, 2011 at 7:43 AM, Orlando L <oralrnr_at_gmail.com> wrote:
> Hello all,
>
> Are hints in queries considered bad, if so why.
>
> Orlando.
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Aug 15 2011 - 02:37:43 CDT

Original text of this message