Amazon DynamoDB stores data in the form of documents (key-value pair), which provides greater flexibility and scalability.When creating a table in DynamoDB, you need to define a partition key and optionally a sort key.DynamoDB uses the partition key value as input to an internal hash function.This mechanism eliminates the need to scan the entire table when performing operations.The Query operation is used when you want to fetch items based on a specific partition key value.The Scan operation in DynamoDB reads every item in a table or secondary index.Global Secondary Index (GSI) in DynamoDB is a secondary index that enables querying a table using non-primary key attributes.It’s important to note that GSIs operate on an eventually consistent model.GSIs storage is billed separately from the main table, with costs depending on the size of the indexed data and the attributes included in the index.By adding GSI on 'UserName' we can make the retrieve operation more efficient.