2 Replies Latest reply: Feb 19, 2018 11:23 AM by Marcus Sommer RSS

    Left Join taking more time

    Amit Saini

      Hi Folks ,

       

      I'm using below script , data is huge no doubt but is there any way that instead of Left Join we can use some other logic to solve the purpose.

      Color indicates keys here.

      CAQ:

      LOAD Facility_Id,

           Product,

           Variant,

           Station,

           Serial,

           Characteristic,

           Values,

           Status,

           DTTSERF

      FROM

      [$(vDataPath)CAQ.qvd]

      (qvd);

       

      Left Join (CAQ)

      LOAD Station_Id,

           Facility_Id,

           Station_CAQ as Station,

           Station_Name

      FROM

      [....\Station.qvd]

      (qvd);

       

      Left Join (CAQ)

      LOAD

           Global_station_Id,

           Station_Id

      FROM

      [.....\Sub_Station.qvd]

      (qvd);

       

      Left Join (CAQ)

      LOAD Station_Id as Global_station_Id,

           LineSection,

           Technology,

           Facility_Id,

           Station_Label,

           Line_Id,

           Supplier_Name

      FROM

      ......

       

      Any Suggestions?

       

      Regards,

      AS

        • Re: Left Join taking more time
          Arvind Patil

          Hi Amit,

           

          I think there is something wrong in script:

           

          CAQ:

          LOAD Facility_Id,

               Product,

               Variant,

               Station,

               Serial,

               Characteristic,

               Values,

               Status,

               DTTSERF

          FROM

          [$(vDataPath)CAQ.qvd]

          (qvd);

           

          Left Join (CAQ)

          LOAD Station_Id,

               Facility_Id,

               Station_CAQ as Station,

               Station_Name

          FROM

          [....\Station.qvd]

          (qvd);

           

          Left Join (CAQ)

          LOAD

               Global_station_Id,

               Station_Id

          FROM

          [.....\Sub_Station.qvd]

          (qvd);

           

          Left Join (CAQ)

          LOAD Station_Id as Global_station_Id,

               LineSection,

               Technology,

               Facility_Id,

               Station_Label,

               Line_Id,

               Supplier_Name

          FROM

          ......

           

          I think  as underline part It may confuse where to join. may be you need to use composite key.

           

          Station_Id &'_'&Facility_Id as KEY1%

           

          Regards,

          Arvind Patil

          • Re: Left Join taking more time
            Marcus Sommer

            In my experience is mapping often significantly faster as joining. Therefore Mapping as an Alternative to Joining.

             

            - Marcus