- 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.
- 玩轉智能機器人程小奔
- Mastering Hadoop 3
- 精通MATLAB神經網絡
- 大數據技術基礎
- Hands-On Machine Learning on Google Cloud Platform
- 機器人智能運動規劃技術
- Visual C# 2008開發技術實例詳解
- Zabbix Network Monitoring(Second Edition)
- Visual C++編程全能詞典
- 悟透JavaScript
- LAMP網站開發黃金組合Linux+Apache+MySQL+PHP
- 網絡服務搭建、配置與管理大全(Linux版)
- SMS 2003部署與操作深入指南
- 電子設備及系統人機工程設計(第2版)
- 在實戰中成長:C++開發之路