课程: AWS for Developers: DynamoDB
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Querying data
- [Instructor] So now that we know that to scan is to simply flip through the records like flipping through cards in a Rolodex. Anybody remember those? With a cost depending on how many items we have to flip through to find our item. So how is querying different than scanning? Well querying data is actually where we find the data based on the primary key, or index, or sort key values. The magic of querying is in a parameter called key condition expression, which allows us to specify the partition and sort key of our table and index, and put that work on the server. Suppose I want to query game stats for a specific date range. I see here that I have six games in my table, but I'm only interested in games between the 15th and the 17th. Now we know one way to do this is to scan it, but that cost won't be good at all, and it won't be performant once we have thousands of games in here. So instead we want to use our partition key, TeamID, and our sort key, the date, to reduce the amount of…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。