Bird
0
0

If a DynamoDB table has an LSI on attribute 'Status' (sort key), what will happen if you try to query the LSI with a partition key value that does not exist in the base table?

medium📝 Predict Output Q5 of 15
AWS - DynamoDB
If a DynamoDB table has an LSI on attribute 'Status' (sort key), what will happen if you try to query the LSI with a partition key value that does not exist in the base table?
AThe query returns all items with the given Status regardless of partition key.
BThe query returns no results because the partition key does not exist.
CThe query returns an error because the partition key is invalid.
DThe query returns all items in the table ignoring the partition key.
Step-by-Step Solution
Solution:
  1. Step 1: Recall LSI partition key behavior

    LSI shares the partition key with the base table; querying requires existing partition key values.
  2. Step 2: Understand query result when partition key missing

    If partition key value does not exist, no items match, so query returns empty result.
  3. Final Answer:

    The query returns no results because the partition key does not exist. -> Option B
  4. Quick Check:

    LSI query = Partition key must exist [OK]
Quick Trick: LSI queries need existing partition key values [OK]
Common Mistakes:
  • Expecting LSI to ignore partition key
  • Thinking query returns error on missing key
  • Assuming LSI queries return all items by sort key only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes