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












2














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





























    2














    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



























      2












      2








      2







      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 Dec 17 at 19:42









      sfdcfox

      247k11188424




      247k11188424










      asked Dec 17 at 19:37









      oobarbazanoo

      37110




      37110






















          1 Answer
          1






          active

          oldest

          votes


















          4














          "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
            Dec 17 at 20:16










          • @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
            Dec 17 at 20:19










          • 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
            Dec 17 at 20:21












          • @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
            Dec 17 at 20:24










          • Got it. Thank you.
            – oobarbazanoo
            Dec 17 at 20:26











          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',
          autoActivateHeartbeat: false,
          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









          4














          "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
            Dec 17 at 20:16










          • @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
            Dec 17 at 20:19










          • 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
            Dec 17 at 20:21












          • @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
            Dec 17 at 20:24










          • Got it. Thank you.
            – oobarbazanoo
            Dec 17 at 20:26
















          4














          "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
            Dec 17 at 20:16










          • @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
            Dec 17 at 20:19










          • 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
            Dec 17 at 20:21












          • @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
            Dec 17 at 20:24










          • Got it. Thank you.
            – oobarbazanoo
            Dec 17 at 20:26














          4












          4








          4






          "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 Dec 17 at 19:41









          sfdcfox

          247k11188424




          247k11188424












          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            Dec 17 at 20:16










          • @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
            Dec 17 at 20:19










          • 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
            Dec 17 at 20:21












          • @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
            Dec 17 at 20:24










          • Got it. Thank you.
            – oobarbazanoo
            Dec 17 at 20:26


















          • Could you, please, provide an example of enqueuing multiple actions at once?
            – oobarbazanoo
            Dec 17 at 20:16










          • @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
            Dec 17 at 20:19










          • 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
            Dec 17 at 20:21












          • @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
            Dec 17 at 20:24










          • Got it. Thank you.
            – oobarbazanoo
            Dec 17 at 20:26
















          Could you, please, provide an example of enqueuing multiple actions at once?
          – oobarbazanoo
          Dec 17 at 20:16




          Could you, please, provide an example of enqueuing multiple actions at once?
          – oobarbazanoo
          Dec 17 at 20:16












          @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
          Dec 17 at 20:19




          @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
          Dec 17 at 20:19












          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
          Dec 17 at 20:21






          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
          Dec 17 at 20:21














          @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
          Dec 17 at 20:24




          @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
          Dec 17 at 20:24












          Got it. Thank you.
          – oobarbazanoo
          Dec 17 at 20:26




          Got it. Thank you.
          – oobarbazanoo
          Dec 17 at 20:26


















          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

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix