DynamoDB query() versus getItem() for single-item retrieval based on the index

后端 未结 4 601
闹比i
闹比i 2021-02-06 20:28

If I\'m retrieving a single item from my table based on the indexed hash key, is there a performance difference between query() or getItem()?

4条回答
  •  粉色の甜心
    2021-02-06 21:10

    getItem will be faster

    getItem retrieve via hash and range key is a 1:1 fit, the time it takes (hence performance) to retrieve it is limited by the hash and sharding internally.

    Query results in a search on "all" range keys. It adds computational work, thus considered slower.

提交回复
热议问题