Ravi Sir's Cards › AWS
Top-N Query
This revision card explains Top-N Query. It starts from the need that scan-all then sort dies at scale. It describes query GSI desc Limit N with padded score#userId SK. The how-to section notes pad scores , then UpdateItem , then Query forward=false Limit 10 , then paginate ESK. An example on the card is priya Nair never Scans for hackathon boards.
Read card text
What this card says
Why do we need it?
Scan-all then sort dies at scale.
What is it?
Query GSI desc Limit N with padded score#userId SK.
top-N
How to do it
Pad scores → UpdateItem → Query forward=false Limit 10 → paginate ESK.
Example
Priya Nair never Scans for hackathon boards.