Ravi Sir's Cards › AWS
What problem does a GSI solve?
This interview card answers: What problem does a GSI solve? Querying by an attribute that is not the table's primary key. Avoids Scan for a second access pattern. Orders by orderId; GSI by customerId+createdAt for "my orders".
Read card text
What this card says
What it is
Querying by an attribute that is not the table's primary key.
Why it matters
Avoids Scan for a second access pattern.
How / example
Orders by orderId; GSI by customerId+createdAt for "my orders".