Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Perfomance

(2) ShareShare
ReportReport
Posted on by
What is better for performance and why??

These two while loops
   while select table1       where table1.AId == _aId             && table1.OC  == OC::B             && table1.ORC  == _bId   {       LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);   }  while select table1                where table1.AId  == _aId                    && table1.OC         == OC::DR                exists join table2                    where table2.OId == table1.OId                exists join table3                    where table3.DId   == table2.DId                        && table3.BId        == _bId{   LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);}
 

OR (combining them)
 
            while select table1                where table1.AId      == _aId                            outer join RecId                     from table2                        where table2.OId == table1.OId                outer join RecId                     from table3                        where table3.DId   == table2.DId                        && (                             (                              table1.OC == OC::DR &&                              table3.BId  == _bId                             )                             ||                             (                              table1.OC == OC::B &&                              table1.ORC    == _bId                             )                           ){     LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);}
 
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,479 Super User 2024 Season 2 on at
    Perfomance
  • CU04051814-0 Profile Picture
    CU04051814-0 on at
    Perfomance
    I will post the code again

    These two while loops
      while select table1 
        where table1.AId == _aId 
              && table1.OC == OC::B 
              && table1.OR == _bId 
    {
        LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);
    }
      
    while select table1
      where table1.AId == _aId
          && table1.OC == OC::DR 
      exists join table2 
            where table2.OId == table1.OId
      exists join table3 
            where table3.DId == table2.DId
               && table3.BId == _bId 
     {
        LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);
     }

    OR combining them
     while select table1
                    where table1.AId      == _aId            
                    outer join RecId 
                        from table2
                            where table2.OId == table1.OId
                    outer join RecId 
                        from table3
                            where table3.DId   == table2.DId
                            && (
                                 (
                                  tabl2.ORC == ORC::DR &&
                                  table3.BId          == _bId
                                 )
                                 ||
                                 (
                                  table1.ORC == ORC::B &&
                                  table1.OR     == _bId
                                 )
                               )
    {
        LanguageTxt::createOrUpdate(table1.TableId, table1.RecId, _description, _languageId);
    }
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans