官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 商洛市| 昌江| 边坝县| 乐昌市| 香河县| 南丹县| 马鞍山市| 蓬莱市| 宜君县| 临夏市| 锡林浩特市| 桂林市| 武隆县| 抚顺县| 石林| 玉林市| 吉安市| 双流县| 皋兰县| 吉水县| 广宁县| 乐至县| 读书| 勐海县| 太原市| 潢川县| 威信县| 兴山县| 永昌县| 凤阳县| 水城县| 买车| 阳信县| 上犹县| 鱼台县| 蓬莱市| 铅山县| 澄城县| 鄂温| 惠东县| 新宁县|