I need to create a table with the following fields : place, date, status
- My keys are parition key - place , sort key - date
- Status can be either 0 or 1
Table has approximately 300k rows per day and about 3 days worth of data at any given time, so about 1 million rows. I have a service that is continuously populating data to this DDB. I need to run the following queries (only) once per day :
#1 Return count of all places with date = current_date-1 #2 Return count and list of all places with date= current_date-1 and status = 0
Questions :
- As date is already a sort key, is query #1 bound to be quick?
- Do we need to create indexes on sort key fields ?
- If answer to above question is yes: for query #2, do I need to create a GSI on date and status? with date as Partition key, and status as sort key?
- Creating a GSI vs using filter expression on status for query #2. Which of the two is recommended?