Archives of the TeradataForum
Message Posted: Tue, 29 May 2012 @ 17:31:03 GMT
The database is going to pick a statistically random sample of the result set to answer a SAMPLE query so it makes no difference if it is sorted or not - the ORDERBY is extra work for no value.
TOP 5 means something different if on an ORDER BY query than on a query without ORDER.
With ORDER, it means exactly the TOP 5 of the sorted set.
Without ORDER it means get the first 5 it can find as quickly as possible.
The latter will be very fast if that is the result you want.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|