A query operation as specified in DynamoDb documentation:
A query operation searches only primary key attribute values and supports a subset of compar
Query is much better than Scan - performence wise. scan, as it's name imply, will scan the whole table. But you must be well aware of the table key, sort key, indexes and and related sort indexes in order to know that you can use the Query. if you filter your query using:
use Query! otherwise use scan which is more flexible about which columns you can filter.
you can NOT Query if:
a good explaination: https://medium.com/@amos.shahar/dynamodb-query-vs-scan-sql-syntax-and-join-tables-part-1-371288a7cb8f