A mistake is always an opportunity to learn, and you should
always take advantage of any opportunity to increase your overall understanding
of how Oracle and its optimizer work.
??”continued??”
Query Optimization | 117
Saving the Optimization
There may be times when youwant to prevent the optimizer from calculating a new
plan whenever a SQL statement is submitted. For example, you might do this if
you??™ve finally reached a point at which you feel the SQL is running optimally, and
you don??™t want the plan to change regardless of future changes to the optimizer or
the database.
Starting with Oracle8i, youcou ld create a stored outline that stored the attributes
used by the optimizer to create an execution plan. Once you had a stored outline, the
optimizer simply used the stored attributes to create an execution plan. As of
Oracle9i, you could also edit the hints that were in the stored outline.
With the release of Oracle Database 11g, Oracle suggests that you move your stored
outlines to SQL plan baselines. Now, in addition to manually loading plans, Oracle
can be set to automatically capture plan histories into these SQL plan baselines.
Pages:
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273