All Forums Database
Teradata_SA 24 posts Joined 02/14
20 Apr 2015
EXPLAIN - Tag Sort

…by way of the sort key in spool field1…

Field1 is created to allow a tag sort.

This is in the Teradata documentation reffering to some explain terminology. I can nowhere howevere seem to find exactly what a tag sort is. Anyone have any ideas ?

jnevill 17 posts Joined 03/12
21 Apr 2015
by way of the sort key in spool field1

Just means that it's sorting on field 1 in whatever Spool it's referring to. The query being explained probably has "ORDER BY 1" in it. 
Offending passage is here:
Some clues about "Tag sort" are here:
Notably: "An additional capability of Teradata is that a column can be used in the ORDER BY that is not selected. This is possible because the database uses a tag sort for speed and flexibility. In other words, it builds a tag area that consists of all the columns specified in the ORDER BY as well as the columns that are being selected.
Although it can sort on a column that is not selected, the sequence of the output may appear to be completely random. This is because the sorted value is not seen in the display."

You must sign in to leave a comment.