I have dynamodb and I use lambda to query the tables using python,
My columns are:
- product_id,
- product_name,
- create_at,
I'd like to be able to sort every column In descending or ascending order. From what I have read, I came to the conclusion that I need to create the first column as Partition, and in every record, I have the same value, let's say "dummy". Moreover, I need to create the create_at as a sort key and; for the other columns I need to create a local secondary index for each of them.Then when I sort, I can do that
response = table.query(
KeyConditionExpression=Key('dummy_col').eq('dummy'),
IndexName=product_name_index
ScanIndexForward=True,
)
what I don't understand is that: will my query Go through all the records like scanning, because of my dummy value in every record?