How does DynamoDB Query functionality work?

DynamoDB provides 2 options to fetch data from collections as Query and Scan. When using Scan, DynamoDB will look through the complete table for records with matching criteria, while Query uses key constraints to perform a direct lookup for a particular data set.

* In addition to the primary key, DynamoDB uses global secondary key, local secondary key, and partition primary key to help improve flexibility and improve the read/ write operation speed.

* As a result, it is fast and time effective compared to the DynamoDB Scan operation and is recommended for most data fetching scenarios.