The sort key is a query language
Conditions on the sort key narrow a Query before it reads, for free.
Why
On the sort key a Query can do more than equals: begins_with, a range with BETWEEN, or simple comparisons like greater-than. Because the partition is already sorted, these narrow the read before it happens.
Run all three and watch the cost. Scanned never climbs above Returned: the key condition decided what to read, so you never pay for items you did not want.
Sort-key conditions narrow before the read. Sorting your data is designing your queries.
These rows are real and already here. Running an operation against them downloads a DynamoDB-compatible engine, about 850 KB, and executes it in this tab.
No sort-key condition: the room meta and every message.
Run an operation to see the raw engine response.