-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
Developer Tools
Problem Statement/Rationale
What is going wrong? What action would you like the Engineering team to take?
When we consolidate indexes from queries we don't support, these indexes are empty as we don't process any field. This doesn't affect the index detection, but when we consolidate indexes, as an empty index is a prefix of any other index, we consider these not supported queries covered. That's misleading, because a MongoDB index can not cover an Atlas Search query.
Steps to Reproduce
How could an engineer replicate the issue you’re reporting?
@Test fun `should not cover empty indexes with other indexes`() { val index = CollectionIndexConsolidation.apply( baseIndex = indexOf("f1" to 1, "f2" to 1) { query { findMany("my.coll".toNs()) { filterBy { predicate(Name.EQ) { schema("should_be_covered") } } } } }, indexes = listOf(indexOf() { query { findMany("my.coll".toNs()) { filterBy { predicate(Name.EQ) { schema("should_NOT_be_covered") } } } } }), options = emptyOptions() ) assertMongoDbIndexIs(arrayOf("f1" to 1, "f2" to 1), index) assertNumberOfCoveredQueriesForIndex(1, index) }
Expected Results
What do you expect to happen?
Actual Results
What do you observe is happening?
Additional Notes
Any additional information that may be useful to include.