Which feature allows guiding the optimizer to prefer certain plans without changing the SQL text?

Prepare for your Database Systems Test. Use flashcards and multiple-choice questions, each question with hints and explanations. Ace your exam!

Multiple Choice

Which feature allows guiding the optimizer to prefer certain plans without changing the SQL text?

Explanation:
Guiding the optimizer without changing the SQL text is done with query hints. A hint is embedded in the SQL statement and serves as a directive to influence how the optimizer selects a execution plan—such as preferring a specific index, a particular join method, or a certain level of parallelism. The key is that the hint nudges the planner toward a preferred path while preserving the query’s semantics; the optimizer may still ignore or override it if a different plan proves better based on statistics and rules. For example, you might see a hint that asks the engine to use a certain index or to choose a hash join over a nested loop. This is different from committing or rolling back (transaction control) or performing a backup, which have no direct effect on how a query is planned or executed.

Guiding the optimizer without changing the SQL text is done with query hints. A hint is embedded in the SQL statement and serves as a directive to influence how the optimizer selects a execution plan—such as preferring a specific index, a particular join method, or a certain level of parallelism. The key is that the hint nudges the planner toward a preferred path while preserving the query’s semantics; the optimizer may still ignore or override it if a different plan proves better based on statistics and rules.

For example, you might see a hint that asks the engine to use a certain index or to choose a hash join over a nested loop. This is different from committing or rolling back (transaction control) or performing a backup, which have no direct effect on how a query is planned or executed.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy