So I have below rows in DynamoDB
with example data. I want to find out the count in below format which means given a file name
as input, output should be the number of events of that file present in the DB
. Currently I have created a GSI
on eventId
as rangekey
and filename
as hashkey
. I am doing query
and pagination
to get the count but its very slow due to number of rows in millions. Is there any other faster way to do it since I need to find only the count and not individual items.
fileName BrandCode Eventid
ABC 123 30100
ABC 367 30100
ABC 891 30111
XYZ 456 40758
XYZ 298 40759
XYZ 296 30111
Basically a file can generate multiple events and each event can be split into multiple Brandcodes.
FileName Count of events
ABC 2
XYZ 3