- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 111字
- 2021-07-03 00:19:31
Selecting more than one row
Let's say we'd like to build an administrative interface that allows employees to access data for several users on one screen. We could, of course, simply perform a query for each username specified, but Cassandra gives us a more efficient way to do this:
SELECT * FROM "users"
WHERE "username" IN ('alice', 'bob');
This query will return two rows: one with the alice primary key and the other with the bob primary key:
Note that while this will be faster than performing two queries, it does require Cassandra to perform two seeks for the two rows, so querying for the additional row comes at some cost.
推薦閱讀
- Ansible Configuration Management
- 基于C語言的程序設(shè)計(jì)
- Mobile DevOps
- Mastering Salesforce CRM Administration
- 樂高創(chuàng)意機(jī)器人教程(中級(jí) 下冊(cè) 10~16歲) (青少年iCAN+創(chuàng)新創(chuàng)意實(shí)踐指導(dǎo)叢書)
- 小型電動(dòng)機(jī)實(shí)用設(shè)計(jì)手冊(cè)
- Implementing Splunk 7(Third Edition)
- 學(xué)會(huì)VBA,菜鳥也高飛!
- Deep Reinforcement Learning Hands-On
- 中國戰(zhàn)略性新興產(chǎn)業(yè)研究與發(fā)展·智能制造裝備
- Introduction to R for Business Intelligence
- 21天學(xué)通Linux嵌入式開發(fā)
- Architectural Patterns
- Building Virtual Pentesting Labs for Advanced Penetration Testing(Second Edition)
- OpenGL Development Cookbook