Maximum number of records retrieved by one SOQL query in a lightning Apex backend controller











up vote
2
down vote

favorite












What is the maximum number of records retrieved by one SOQL query in a lightning Apex backend controller?



According to this:




Total number of records retrieved by SOQL queries | 50,000




But for me it is not clear why querieS and not query is used there.



Does it mean that in total in one call to Apex backend controller from my lightning component I can retrieve 50,000? Or does it mean that in one query I can retrieve 50,000?










share|improve this question




























    up vote
    2
    down vote

    favorite












    What is the maximum number of records retrieved by one SOQL query in a lightning Apex backend controller?



    According to this:




    Total number of records retrieved by SOQL queries | 50,000




    But for me it is not clear why querieS and not query is used there.



    Does it mean that in total in one call to Apex backend controller from my lightning component I can retrieve 50,000? Or does it mean that in one query I can retrieve 50,000?










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      What is the maximum number of records retrieved by one SOQL query in a lightning Apex backend controller?



      According to this:




      Total number of records retrieved by SOQL queries | 50,000




      But for me it is not clear why querieS and not query is used there.



      Does it mean that in total in one call to Apex backend controller from my lightning component I can retrieve 50,000? Or does it mean that in one query I can retrieve 50,000?










      share|improve this question















      What is the maximum number of records retrieved by one SOQL query in a lightning Apex backend controller?



      According to this:




      Total number of records retrieved by SOQL queries | 50,000




      But for me it is not clear why querieS and not query is used there.



      Does it mean that in total in one call to Apex backend controller from my lightning component I can retrieve 50,000? Or does it mean that in one query I can retrieve 50,000?







      apex lightning-aura-components soql governorlimits






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 6 hours ago









      sfdcfox

      245k11185419




      245k11185419










      asked 7 hours ago









      oobarbazanoo

      31110




      31110






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          "Queries" is plural because it is a cumulative limit across all queries called in a single transaction, not a per-query limit. Lightning components also use a "boxcar" behavior, so if you enqueue multiple actions at once, the 50,000 row limit will be split across all enqueued actions. You can get 50,000 rows in one query, but then you won't have any more rows left if you need a second query.






          share|improve this answer





















          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            6 hours ago










          • @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
            – sfdcfox
            6 hours ago










          • Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
            – oobarbazanoo
            6 hours ago












          • @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
            – sfdcfox
            6 hours ago










          • Got it. Thank you.
            – oobarbazanoo
            6 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "459"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f243900%2fmaximum-number-of-records-retrieved-by-one-soql-query-in-a-lightning-apex-backen%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          "Queries" is plural because it is a cumulative limit across all queries called in a single transaction, not a per-query limit. Lightning components also use a "boxcar" behavior, so if you enqueue multiple actions at once, the 50,000 row limit will be split across all enqueued actions. You can get 50,000 rows in one query, but then you won't have any more rows left if you need a second query.






          share|improve this answer





















          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            6 hours ago










          • @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
            – sfdcfox
            6 hours ago










          • Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
            – oobarbazanoo
            6 hours ago












          • @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
            – sfdcfox
            6 hours ago










          • Got it. Thank you.
            – oobarbazanoo
            6 hours ago















          up vote
          4
          down vote



          accepted










          "Queries" is plural because it is a cumulative limit across all queries called in a single transaction, not a per-query limit. Lightning components also use a "boxcar" behavior, so if you enqueue multiple actions at once, the 50,000 row limit will be split across all enqueued actions. You can get 50,000 rows in one query, but then you won't have any more rows left if you need a second query.






          share|improve this answer





















          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            6 hours ago










          • @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
            – sfdcfox
            6 hours ago










          • Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
            – oobarbazanoo
            6 hours ago












          • @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
            – sfdcfox
            6 hours ago










          • Got it. Thank you.
            – oobarbazanoo
            6 hours ago













          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          "Queries" is plural because it is a cumulative limit across all queries called in a single transaction, not a per-query limit. Lightning components also use a "boxcar" behavior, so if you enqueue multiple actions at once, the 50,000 row limit will be split across all enqueued actions. You can get 50,000 rows in one query, but then you won't have any more rows left if you need a second query.






          share|improve this answer












          "Queries" is plural because it is a cumulative limit across all queries called in a single transaction, not a per-query limit. Lightning components also use a "boxcar" behavior, so if you enqueue multiple actions at once, the 50,000 row limit will be split across all enqueued actions. You can get 50,000 rows in one query, but then you won't have any more rows left if you need a second query.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 6 hours ago









          sfdcfox

          245k11185419




          245k11185419












          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            6 hours ago










          • @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
            – sfdcfox
            6 hours ago










          • Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
            – oobarbazanoo
            6 hours ago












          • @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
            – sfdcfox
            6 hours ago










          • Got it. Thank you.
            – oobarbazanoo
            6 hours ago


















          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            6 hours ago










          • @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
            – sfdcfox
            6 hours ago










          • Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
            – oobarbazanoo
            6 hours ago












          • @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
            – sfdcfox
            6 hours ago










          • Got it. Thank you.
            – oobarbazanoo
            6 hours ago
















          Could you, please, provide an example of enqueuing multiple actions at once?
          – oobarbazanoo
          6 hours ago




          Could you, please, provide an example of enqueuing multiple actions at once?
          – oobarbazanoo
          6 hours ago












          @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
          – sfdcfox
          6 hours ago




          @oobarbazanoo var a1 = c.get("c.action1"), a2 = c.get("c.action2"); ... $A.enqueueAction(a1); $A.enqueueAction(a2);. if you do this, the limits are shared across both actions. This occurs up to about 5-6 enqueued actions at once. This has other effects, like if you callout after a DML, etc.
          – sfdcfox
          6 hours ago












          Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
          – oobarbazanoo
          6 hours ago






          Does it depend on the performance of the device and internet whether or not the enqueued actions will be performed in one call? I mean if I will for instance have a bad network and enqueue one action, then in two minutes another and so on, but my network connect will stabilize only in half an hour, then all those actions will be executed simultaneously or will they be splitted?
          – oobarbazanoo
          6 hours ago














          @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
          – sfdcfox
          6 hours ago




          @oobarbazanoo There's an upper limit to how many actions will fire at once, but I'm not sure how the system decides this. It seems to be about 4-6 actions will go in each payload. When in doubt, use a Promise chain or call them in callback handlers. Usually, from what I've seen, it's pretty reasonable unless you're loading large amounts of data. There's also the setBackground action that can delay calls you know will be close to the limit.
          – sfdcfox
          6 hours ago












          Got it. Thank you.
          – oobarbazanoo
          6 hours ago




          Got it. Thank you.
          – oobarbazanoo
          6 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Salesforce Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f243900%2fmaximum-number-of-records-retrieved-by-one-soql-query-in-a-lightning-apex-backen%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Contact image not getting when fetch all contact list from iPhone by CNContact

          count number of partitions of a set with n elements into k subsets

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks