|
|
Archives of the TeradataForum
Message Posted: Thu, 07 Jun 2012 @ 23:06:40 GMT
Subj: | | Re: Impact on spool between SELECT TOP and with ORDER BY |
|
From: | | Walter, Todd |
The two queries mean two different things. With the ORDER BY the database must execute the whole query and sort the whole result to ensure that
the first N per the sort order are returned - this will take more spool. But the top N without order by will just go read that many rows from the
table without having to sort or read the whole source.
| |