- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 172字
- 2021-07-03 00:19:38
Looking up rows by partition
The core reading experience of the MyStatus application will be an interface to read a given user's status updates. In order to do this, we need to be able to retrieve status updates for a given user from the user_status_updates table. As you might expect, this follows naturally from the CQL syntax we've seen in previous chapters:
SELECT * FROM "user_status_updates"
WHERE "username" = 'alice';
Previously, we've used the WHERE keyword to specify an exact value for a full primary key. In the preceding query, we only specify the partition key part of the primary key, which allows us to retrieve only those rows that we've asked for the partition:
In the results, we only see the rows whose username is alice. To emphasize what we discussed in the previous chapter, in the Looking up a specific status update section, this is a very efficient query. Cassandra stores all of alice's status updates together, already in order; so returning this view of the table is quite inexpensive.
- 玩轉(zhuǎn)智能機(jī)器人程小奔
- 輕輕松松自動(dòng)化測(cè)試
- 我的J2EE成功之路
- Effective DevOps with AWS
- 精通Excel VBA
- 自動(dòng)化控制工程設(shè)計(jì)
- PyTorch Deep Learning Hands-On
- 大數(shù)據(jù)驅(qū)動(dòng)的機(jī)械裝備智能運(yùn)維理論及應(yīng)用
- 貫通Java Web開發(fā)三劍客
- Learn QGIS
- Web璀璨:Silverlight應(yīng)用技術(shù)完全指南
- FANUC工業(yè)機(jī)器人配置與編程技術(shù)
- 傳感器原理與工程應(yīng)用
- 計(jì)算機(jī)辦公應(yīng)用培訓(xùn)教程
- 探索中國(guó)物聯(lián)網(wǎng)之路