During a sorted list scan operation, the entire temporary sorted list is scanned and all of the entries contained within the sorted list will be processed.
A sorted list scan is generally considered when the optimizer is considering a plan that requires the data values to be sequenced. The use of a sorted list scan will allow the optimizer to generate a plan that can take advantage of any non-join selection while creating the temporary sorted list. An additional benefit of using a sorted list scan is that the data structure of the temporary sorted list will usually cause the table data within the sorted list to remain resident within main memory after creation thus reducing paging on the subsequent sorted list scan operation.
Data access method | Sorted list scan |
---|---|
Description | Read all of the entries in a temporary sorted list. The sorted list may perform distinct processing to eliminate duplicate values or take advantage of the temporary sorted list to sequence all of the rows. |
Advantages |
|
Considerations | Generally used to process ordering or distinct processing. Can perform poorly when the entire sorted list does not stay resident in memory as it is being populated and processed. |
Likely to be used |
|
Example SQL statement | CREATE INDEX X1 ON Employee (LastName, WorkDept) SELECT * FROM Employee WHERE WorkDept BETWEEN 'A01' AND 'E01' ORDER BY FirstNme OPTIMZE FOR ALL ROWS |
Messages indicating use | There are multiple ways in which a sorted list scan
can be indicated through the messages. The messages in this example illustrate
how the SQL Query Engine will indicate a sorted list scan was used.
|
SMP parallel enabled | No |
Also referred to as | Sorted List Scan, Preload Sorted List Scan Distinct Sorted List Scan Distinct, Preload |
Visual Explain icon |