Today we have two separate optimized index scans: COUNT_SCAN and DISTINCT_SCAN. COUNT_SCAN will return simple sentinel values as it scans the index, avoiding the cost of translating the index key format to the format the query plan needs/understands. DISTINCT_SCAN can seek over large sections of the index where the values are identical, but still materializes an object outside the index key for consumption by the query plan. These two optimizations could be combined in the case of a query like
This would lead to better performance, unclear how much.