Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23406

index scan is slower than full collection scan in some scenarios

    XMLWordPrintable

Details

    • Improvement
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • Querying
    • 0

    Description

      Tested with WiredTiger which seems to exhibit this more than MMAP.

      Covered index query which has to return all the documents from a collection is slower than just a full collection scan even in cases where index is quite small and collection is very large.

      Looking at where we spend time, it appears for each "document" we need to "synthesize" from the index we allocate and free some memory. We apparently have some optimization for avoiding that in collection scan but not full index scan. This is to track the same optimization for index scan.

      Attachments

        1. flame-graph-screenshot.png
          flame-graph-screenshot.png
          631 kB
        2. flame-graph-screenshot.png
          flame-graph-screenshot.png
          177 kB
        3. ixscan-flamegraph.svg
          256 kB
        4. Screenshot 2016-04-12 15.51.00.png
          Screenshot 2016-04-12 15.51.00.png
          762 kB
        5. Screenshot 2016-04-12 16.35.16.png
          Screenshot 2016-04-12 16.35.16.png
          581 kB
        6. Screenshot 2016-04-12 17.53.37.png
          Screenshot 2016-04-12 17.53.37.png
          482 kB
        7. Screenshot 2016-04-12 17.53.59.png
          Screenshot 2016-04-12 17.53.59.png
          471 kB
        8. time-ixscan-vs-collscan.js
          1 kB

        Issue Links

          Activity

            People

              backlog-query-execution Backlog - Query Execution
              asya.kamsky@mongodb.com Asya Kamsky
              Votes:
              0 Vote for this issue
              Watchers:
              44 Start watching this issue

              Dates

                Created:
                Updated: