Counting the results
SimpleDB provides a simple way for you to count the number of items in a result set. You can get the number of items only by specifying the keyword count(*)
in the predicate. There is no restriction on the maximum number of counted results. However, there are certain limits placed by SimpleDB on the query itself:
The count request must not take more than five seconds. In case it exceeds the five second time limit, SimpleDB will return the number of items that it could count until the timeout, and a next token to return additional results. You will need to use the returned marker token in your next query to request the remaining items.
Sometimes, your request may time out. If this is the case, SimpleDB will return a 408 error that is a 'Request Timeout'. You will need to resubmit the request.
COUNT()
Retrieve the number of songs in our songs
domain that were released before 2000:
SELECT count(*) FROM songs WHERE Year < '2000'
Returns:
Item: Domain Count = 6
Retrieve the...