|
|
Archives of the TeradataForum
Message Posted: Wed, 22 Jun 2005 @ 17:08:54 GMT
Subj: | | Re: Sort before Join |
|
From: | | Duell, Bob |
Brian asked:
| Is "sort before join" common to most/all database programs? Even in SAS, you have to sort the datasets before joining them. | |
If by "SAS" you're referring to native SAS data sets, then sorting is *not necessarily* required before a join (in PROC SQL), a merge (in a
DATA step), or BY-statement processing in a SAS procedure.
If your SAS data set has a relevant matching INDEX, the index will be used and sorting is not needed (and in fact, would defeat the purpose of
a SAS index).
I can't say for sure, but I bet most databases work the same way: you only have to sort when an index does not exist.
| |