Performing Queries

The SimpleDB service allows you to perform queries on your data through a Query API operation. The service only understands queries that are expressed in a simple query language that is specific to SimpleDB. These queries include a set of attribute predicates that are compared against the items stored in one of your domains. The names of items that satisfy all of the predicates are returned by the Query operation.

The SimpleDB Query operation and query language work very differently than the Structured Query Language (SQL) that is supported by relational databases. These differences can add to the complexity of applications that use the SimpleDB service, because the application may be required to do more work to retrieve, organize, and interpret the results of query operations than is normally the case. There are four key areas in which your applications may have to make up for shortcomings in the SimpleDB query language and API.

Query results do not include attribute values

When you perform a SimpleDB query operation, the service returns a list of items that match the query. The matching items are identified by their names in the query results, but this is the only information returned by the service; none of the items’ attribute names or values are included. This means that client applications must perform follow-up GetAttributes operations (see Retrieve an Item’s Attributes”) to retrieve the actual attribute data associated with each result item. If you ...

Get Programming Amazon Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.