How can we improve Azure Cosmos DB?

DISTINCT should use index if possible

Currently one can query distinct values from documents using the DISTINCT keyword like in relational SQL.

Example:
SELECT distinct c.myField FROM c

Related feature request: https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/6719531-provide-support-for-distinct

Unfortunately current DISTINCT is rather unusable as it seems to do a full scan even if there is an index present on the field. This feature does save some bandwidth when you really-really-really need this feature, but the RU consumption part is borderline-unacceptable for production use.

Please consider improving the implementation to avoid full scan and use index, if possible.

11 votes
Vote
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
You have left! (?) (thinking…)
Imre Pühvel shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base