Re: OPT_GOAL
Posted in 2003
Greg Mitchell wrote: > Does anyone have any comments on OPT_GOAL > > We've experimented with setting it to 0 and found it to be detrimental > to batch processing jobs. Not surprising! Setting it to 0 (zero) will return the first few rows as quickly as possible, but will probably take longer if you do decide to return the entire record set. Whereas the default of -1 will return the entire record set as quickly as possible. > My understanding is that it will influence the optimizer to choose a > path that will return the first rows quickly but not necessarily ALL > rows quicker than if it had been left at the default of -1. Correct, so not very good for batch processing then. > What's it's application? Is anyone using it effectively as an > ONCONFIG parameter, or is everyone using it as an environment > variable. A typical application is a popup list of values. You want to display the first few records as quickly as possible, but the rest are only needed if the user scrolls down to look at them. You can override the configuration parameter with the environment variable. You can also override those settings by using the SET OPTIMIZATION command. My feeling is that the SET OPTIMIZATION command is the most useful as you can switch it on and off around certain queries. Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /| | Mydas Solutions Ltd http://MydasSolutions.com |///// / //| | +-----------------------------------+//// / ///| | |We value your comments, which have |/// / ////| | |been recorded and automatically |// / /////| | |emailed back to us for our records.|/ ////////| +----------------------+-----------------------------------+-----------+