Pankaj Mehta |
Join StrategiesTeradata supports a number of Join strategies. The join strategy for a query is chosen by the optimizer at compile time. The optimizer chooses by evaluating the relative cost of each possible strategy and choosing the best. Most Teradata joins operate on two tables at a time. The optimizer builds a query plan out of successive two table joins until the result relation has been built. All joins are fully parallelized. The optimizer has three major joins to choose from:
There are many variants available to the Teradata optimizer. It may join directly to an index sub-table rather than to the base table if all the fields required are present in the index. It may join to an index and extract rowids from the index table, placing them into a spool table to later be sorted and joined back to the base table to extract other rows. |
| Different Joins Available in Teradata
|
Teradata’s Star JoinTeradata implements a star join with minimal data movement between VPROCs by only moving rows from the smaller dimension tables. The rows from the much larger fact table remain in place, local to their VPROC. For this to work, the primary index of the large fact table (the BIG table in the diagram below) must be specified as a composite of the primary index columns of all of the dimension tables (Weeks, Stores, and Items). In the example, the primary index of the BIG table would be (B_Itemkey,B_StoreID,B-WeekID). |
![]() |
| Following steps are carried out in Star Joins:
The Teradata optimizer will automatically consider a star join if the physical database has been designed based on a star schema. |