DynamoDB stores an item under its full primary key. A global secondary index supplies another key for a different access pattern. An item missing an index key doesn't enter that index, so an index query isn't a complete inventory of the base table.
Conditional writes protect a decision at write time. A condition such as attribute_not_exists(customer) applies to the existing item at the supplied complete key, not to every item with that customer value. Read pagination just as carefully. Limit bounds the items evaluated before FilterExpression removes nonmatches. A page can therefore contain no returned items and still include LastEvaluatedKey. Continue with that complete key instead of treating the empty page as the end. You will build an index, insert a guarded receipt, and inspect both sides of a filtered page boundary.