EXPLAIN - Tag Sort


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 ?



Re: EXPLAIN - Tag Sort

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: http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/SQL_Reference/B035_1142_111A/ch05...

Some clues about "Tag sort" are here: http://www.wisdomjobs.com/e-university/teradata-tutorial-212/fundamental-sql-using-select-970/order-...

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."