ASA SQL User's Guide
Query Optimization and Execution
How the optimizer works
Underlying assumptions
The OPTIMIZATION_GOAL option allows you to specify whether query processing should be optimized towards returning the first row quickly, or minimizing the cost of returning the complete result set. The default is first row.
For more information, see OPTIMIZATION_GOAL option [database].