3 Replies Latest reply: Sep 3, 2014 11:13 AM by Evan Kurowski RSS

    Optimized load using where Exists

    Jerry Lau

      Hi all,

       

      I read from web resources that you can use "where exists" to do an optimized load

      I have tried a simple example below but it does not perform what is expected

      Can anyone point out what's wrong with it?  Thanks

       

      //tmp:

      //load * Inline [

      //   id, flag

      //   1, 1

      //   2, 1

      //   3, 1

      //   4, 0

      //   5, 0

      //   6, 1

      //   7, 0

      //   8, 1

      //   9, 0

      //   10, 1

      //];

      //

      //STORE tmp into tmp.QVD;

      //DROP Table tmp;

       

      flag:

      LOAD

         1 as flag

      AutoGenerate 1;

       

      tmp:

      load

         id

      From tmp.QVD(qvd)

      where exists (flag,flag);

       

      DROP Table flag;

        • Re: Optimized load using where Exists
          Evan Kurowski

          Jerry Lau wrote:

           

          Hi all,

           

          I read from web resources that you can use "where exists" to do an optimized load

          I have tried a simple example below but it does not perform what is expected

          Can anyone point out what's wrong with it?  Thanks

           

           

           

          tmp:

          load

            id

          From tmp.QVD(qvd)

          where exists (flag,flag);

           

          DROP Table flag;

          Hello Jerry,

           

          When I take this script segment and add the field [flag] to the statement involving exists(), I get a restoration of the optimized load message.  try:

           

          tmp:

          load id, flag

          From tmp.QVD(qvd)

          where exists (flag, flag)