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

indexFilterSet is always False with verbosity of "executionStats" or above

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Hide

      For example:

      db.test.createIndex({a:1,b:1,c:1,d:1, g:1},{name:"g1"})
      db.test.createIndex({a:1,b:1,c:1,d:1, e:1},{name:"e1"})
      db.test.createIndex({a:1,b:1,c:1,d:1, f:1},{name:"f1"})
      

      Create an index filter for one of the indexes:

      db.runCommand(
      {
       planCacheSetFilter: "test",
       query: 
      {a:1,b:1,c:1,d:1},
      indexes:[{a:1,b:1,c:1,d:1, f:1}]
      })
      

      Run the following query:

      db.test.explain("executionStats").find({a:1,b:1,c:1,d:1})
      

      The index is used but indexFilterSet is false in the explain() output

      Clear the index filter:

      db.runCommand( { planCacheListFilters: "test" } )
      

      Create a filter for a different index:

      db.runCommand( { planCacheSetFilter: "test", query: {a:1,b:1,c:1,d:1}, indexes:[{a:1,b:1,c:1,d:1, g:1}] })
      

      Now re-run the query.

      The index is used, but indexFilterSet is false

      Show
      For example: db.test.createIndex({a:1,b:1,c:1,d:1, g:1},{name: "g1" }) db.test.createIndex({a:1,b:1,c:1,d:1, e:1},{name: "e1" }) db.test.createIndex({a:1,b:1,c:1,d:1, f:1},{name: "f1" }) Create an index filter for one of the indexes: db.runCommand( { planCacheSetFilter: "test" , query: {a:1,b:1,c:1,d:1}, indexes:[{a:1,b:1,c:1,d:1, f:1}] }) Run the following query: db.test.explain( "executionStats" ).find({a:1,b:1,c:1,d:1}) The index is used but indexFilterSet is false in the explain() output Clear the index filter: db.runCommand( { planCacheListFilters: "test" } ) Create a filter for a different index: db.runCommand( { planCacheSetFilter: "test" , query: {a:1,b:1,c:1,d:1}, indexes:[{a:1,b:1,c:1,d:1, g:1}] }) Now re-run the query. The index is used, but indexFilterSet is false
    • QE 2021-11-15, QE 2021-11-29, QE 2021-12-13, QE 2021-12-27, QE 2022-01-10, QO 2022-03-07, QO 2022-03-21, QE 2022-01-24, QO 2022-04-04

      In the documentation for Index Filters ,it says:

      To see whether MongoDB applied an index
      filter for a query shape, check the indexFilterSet
      field of either the db.collection.explain() or the
      cursor.explain() method.
      

      However in practice, this doesn't seem to indicate whether an index filter is being used and seems to remain false.

      (Tested on v4.4.9 and v5.0.2)

            Assignee:
            anton.korshunov@mongodb.com Anton Korshunov
            Reporter:
            ronan.merrick@mongodb.com Ronan Merrick
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: