Proper interpretation of Azure Advisor's recommendation 'Add missing indexes to your Azure Cosmos DB container'
Hello,
I have an Azure Cosmos Db set up. Recently I've got an Azure Advisor's recommendation to add some indexes to the database:
Add missing indexes to your Azure Cosmos DB container
Potential Indexes - "/someField1 ASC","/someField2 ASC","/someField3 ASC ","/someField4 ASC","/someField5 ASC"
My current indexing policy is default which covers all the fields:
{
"includedPaths": [
{
"path": "/*"
}
]
}
By following the recommendation am I supposed to add the following single composite index?:
{
"compositeIndexes": [
[
{
"path": "/someField1",
"order": "ascending"
},
{
"path": "/someField2",
"order": "ascending"
},
{
"path": "/someField3",
"order": "ascending"
},
{
"path": "/someField4",
"order": "ascending"
},
{
"path": "/someField5",
"order": "ascending"
}
]
]
}
I've tried adding that composite index but the recommendation did not go away and my query performance got worse because the planner started using that composite index instead of the multiple single indexes (as the query planner showed).
Am I missing something here? Just wanted to be sure I'm interpreting the recommendation correctly and can rely on Azure Advisor's recommendation.
With best regards,
Vladimir