|
Archives of the TeradataForumMessage Posted: Wed, 25 Jun 2003 @ 11:41:09 GMT
Anomy, I've reworded and ellaborated on some examples I pulled from a V2R5 presentation... Early Group By: TblA (ColA, ColB, Part_No, Vol_Sold) TblB (ColC, Part_No, Available_Qty) TblA - 500 million rows and 10,000 unique occurences of Part_No TblB - 100 million rows and 10,000 unique occurences of Part_No Select TblA.Part_No , Sum(TblA.Vol_Sold) , Sum(TblB.Available_Qty) From TblA , TblB Where TblA.Part_No = TblB.Part_No Group By 1 -Pre V2R5, the optimizer would have joined all 500 million rows of the TblA to all 100 million rows of TblB before grouping resulting spool on TblA.Part_No (while summing Vol_Sold and Available_Qty) -With V2R5, the optimizer will first group TblA on Part_No (while summing Vol_Sold) in parallel (?) with grouping TblB on Part_No (while summing Available_Qty). Once complete, the optimizer will then join the resulting 2 spool files together via Part_No Partial Group By (I'm not 100% certain about this one): TblA (ColA, ColB, Part_No, Vol_Sold) TblC (Part_No, Part_Nm) TblA - 500 million rows and 10,000 unique occurences of Part_No TblC - 10,000 rows where Part_No is Primary Key Select TblC.Part_No , sum(TblA.Vol_Sold) From TblA , TblC Where TblA.Part_No = TblC.Part_No GroupB y 1 Pre-V2R5, the optimizer would have joined TblA to TblC on Part_No prior to grouping data by TblC.Part_No and summing TblA.Vol_Sold With V2R5, the optimizer first groups TblA on Part_No while summing Vol_Sold, then joins the resulting spool file to TblC on Part_No Hope this helps (and is accurate) Clay
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||