I am wondering about the underlying PartiQL implementation of the SELECT ... WHERE PrimaryKey IN
statement with respect to its performance in DynamoDB.
Example:
SELECT * FROM Table WHERE PK IN [1, 2, 3]
Given that the lower-level Query API - Key condition expressions for query does not support IN
statement, only =
on key condition (source). Does this mean that this will result in 3 queries to DynamoDB or is it a single one ?
Or is this implemented using a filter expression on the results under the hood , which supports IN
?
It still sends a single request to DynamoDB. But when the request hits the backend, it's executed in 3 Query calls sequentially. So it's useful for simplicity but not as performant as executing 3 individual Query calls async.