DynamoDB query()与getItem()进行基于索引的单项检索 [英] DynamoDB query() versus getItem() for single-item retrieval based on the index

查看:76
本文介绍了DynamoDB query()与getItem()进行基于索引的单项检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我基于索引的哈希键从表中检索单个项目, query() getItem()之间是否存在性能差异?

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()?

推荐答案

getItem 会更快

getItem 检索符合1:1的要求,检索所需的时间(因此,性能)受哈希和内部分片的限制.

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.

这篇关于DynamoDB query()与getItem()进行基于索引的单项检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆