开发者

Does Cassandra support conditional queries?

I'm thinking of switching to cassandra from my current SQL-esque solution (simpledb) mainly due to speed, cost and the built in caching feature of cassandra. However I'm stuck on the idea of indexing. Ive gathered that in cassandra you have to manually create indexes in order to execute complex queries. But what if you have data like t开发者_开发知识库he following, a row with a simple supercolumn:

row1 {value1="5", value2="7", value3="9"}

And you need to execute dynamic queries like "give me all the rows with value1 between x and y and value2 between z and q, etc. Is this possible? Or if you have queries like this is it a bad idea to use cassandra?


Cassandra 0.7.x contains secondary index that let you make queries like the one above. The following blog post describes the concept: http://www.riptano.com/blog/whats-new-cassandra-07-secondary-indexes


Secondary indices were introduced in 0.7. However, to use an indexed_slice_query, you need to have at least one equals expression. For example, you can do value1 = x and value2 < y, but not both range queries.

See Cassandra API

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜