[SERVER-60710] indexFilterSet is always False with verbosity of "executionStats" or above Created: 14/Oct/21  Updated: 29/Oct/23  Resolved: 30/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Ronan Merrick Assignee: Anton Korshunov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-66233 Tag index_filter_commands.js with req... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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

Sprint: 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
Participants:

 Description   

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)



 Comments   
Comment by Githook User [ 29/Mar/22 ]

Author:

{'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}

Message: SERVER-60710 indexFilterSet is always False with verbosity of "executionStats" or above
Branch: master
https://github.com/mongodb/mongo/commit/0c0cd056def9aeeddaf9c500433de4f13faf0e54

Comment by Kyle Suarez [ 01/Feb/22 ]

Sorry for losing track of this ticket – moving it back into the queue for re-triage.

Generated at Thu Feb 08 05:50:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.