Archives of the TeradataForum
Message Posted: Wed, 05 Jan 2005 @ 23:39:22 GMT
| Subj: || || Re: Effect of ORDER BY in performance |
| From: || || Christie, Jon |
The primary use of the estimates you see in explains is to aid the optimizer in choosing between alternate plans based on the cost of the
plans. The cost of sorting the final result spool (as must be done when the request has an ORDER BY clause) is of no concern to the optimizer in
making this choice. If there is an ORDER BY clause, the final spool must be sorted. If there is no ORDER BY clause, the final results spool does
not need to be sorted. So the estimated cost of the sort is not included in the step that produces the final result spool.
Your desire to know the estimated cost of the sort is a secondary use of the estimate and is not currently supported. This might be a good
candidate for a Partners ER (Enhancement Request).