-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: No Action
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
We define the $count=true query option as returning an estimate of the number of records matching the request. In OData-1516 we introduced control information that a service could return in order to convey the accuracy of the inline count, and specifically to enabling returning a partial count where counting all of the items was too expensive.
/$count in the resource path is defined to be an exact count. If an implementation can't return an exact count it is required to fail the request. However, in the case that the implementation has reached a limit in counting matching records there is no way for the service to convey to the implementation the partial count reached.
For backward compatibility I think we need to continue returning an error, and /$count used within an expression definitely must error if an exact count cannot be returned, but it would be nice to have a way to return the fact that an error was being returned because a certain threshold had been reached.
We could return this information as an annotation within the returned error, or as a header. Alternatively, we could define a preference header that the client could specify to say that they were willing to accept an incomplete count, and a preference-applied header that the service could return in the response to specify the accuracy of the count.