Optimize for first row or for entire result set

The optimization_goal option allows you to specify whether query processing should be optimized towards returning the first row quickly, or towards minimizing the cost of returning the complete result set (the default behavior). See optimization_goal option [database].