I have a document type like this
We have millions of them.
I am looking to query like this:
Select distinct widgetId from default where type = ‘123’
I create a partial index like so:
widgetId))) WHERE (
The query does not hit the above index even with an explicit hint.
Also the index stats (items, and data size) indicate that all the millions of documents are represented in the index, where there should only be about 10k (distinct widgetIds).
- What am I missing about how indexes work?
- How can I write an index that will allow me to get the data efficiently?