title: Distinct Query is not properly working in Cosmos DB
body: <p>I have about 100 thousand records in Cosmos DB. I want to get the distinct records by some property. I am using Stored Procedure to acheive this and sets the page size to -1 to get the maximum records. When i fire a query without distinct, i get about 19 thousand records. At the same time if i fired the distinct query, it gives me distinct records, and the distinct applied with in the undistincted 19 thousand records instead of the entire 100 thousand records.</p>
  
  <p>Below is the query i have used:</p>
  
  <p><strong>SELECT r.[[FieldName]] FROM r</strong> -> returns 19000 records with duplicates</p>
  
  <p><strong>SELECT DISTINCT r.[[FieldName]] FROM r</strong> -> returns distinct records (few about 5000) which are distincted from the above 19000 records instead of 100 thousand records</p>