Help understanding mongodb explain results The Next CEO of Stack Overflow

How to count occurrences of text in a file?

Can you be charged for obstruction for refusing to answer questions?

A small doubt about the dominated convergence theorem

WOW air has ceased operation, can I get my tickets refunded?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Do I need to write [sic] when a number is less than 10 but isn't written out?

What flight has the highest ratio of time difference to flight time?

What was the first Unix version to run on a microcomputer?

Is it okay to majorly distort historical facts while writing a fiction story?

Why is quantifier elimination desirable for a given theory?

How to check if all elements of 1 list are in the *same quantity* and in any order, in the list2?

Is French Guiana a (hard) EU border?

Is it possible to replace duplicates of a character with one character using tr

Why isn't acceleration always zero whenever velocity is zero, such as the moment a ball bounces off a wall?

Why, when going from special to general relativity, do we just replace partial derivatives with covariant derivatives?

Why do airplanes bank sharply to the right after air-to-air refueling?

Should I tutor a student who I know has cheated on their homework?

Is there a difference between "Fahrstuhl" and "Aufzug"

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Is it convenient to ask the journal's editor for two additional days to complete a review?

Does Germany produce more waste than the US?

Would a completely good Muggle be able to use a wand?

What happened in Rome, when the western empire "fell"?

Newlines in BSD sed vs gsed



Help understanding mongodb explain results



The Next CEO of Stack Overflow












0















I have an index on field f1. {f1:1}



Running an explain on the following query



db.coll.find()


says that the winning plan is a CollScan (expected)



However, for db.coll.find().sort({f1:1})



the explain says



"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",


I have trouble understanding this because even though the index is used for sorting , shouldn't it have done a collection scan to fetch the documents that needed to be sorted?



Thank you









share



























    0















    I have an index on field f1. {f1:1}



    Running an explain on the following query



    db.coll.find()


    says that the winning plan is a CollScan (expected)



    However, for db.coll.find().sort({f1:1})



    the explain says



    "stage" : "FETCH",
    "inputStage" : {
    "stage" : "IXSCAN",


    I have trouble understanding this because even though the index is used for sorting , shouldn't it have done a collection scan to fetch the documents that needed to be sorted?



    Thank you









    share

























      0












      0








      0








      I have an index on field f1. {f1:1}



      Running an explain on the following query



      db.coll.find()


      says that the winning plan is a CollScan (expected)



      However, for db.coll.find().sort({f1:1})



      the explain says



      "stage" : "FETCH",
      "inputStage" : {
      "stage" : "IXSCAN",


      I have trouble understanding this because even though the index is used for sorting , shouldn't it have done a collection scan to fetch the documents that needed to be sorted?



      Thank you









      share














      I have an index on field f1. {f1:1}



      Running an explain on the following query



      db.coll.find()


      says that the winning plan is a CollScan (expected)



      However, for db.coll.find().sort({f1:1})



      the explain says



      "stage" : "FETCH",
      "inputStage" : {
      "stage" : "IXSCAN",


      I have trouble understanding this because even though the index is used for sorting , shouldn't it have done a collection scan to fetch the documents that needed to be sorted?



      Thank you







      index mongodb explain





      share












      share










      share



      share










      asked 1 min ago









      smksmk

      1011




      1011






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          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%2fdba.stackexchange.com%2fquestions%2f233593%2fhelp-understanding-mongodb-explain-results%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators 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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f233593%2fhelp-understanding-mongodb-explain-results%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

          Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...