1
votes

I have worked with other NoSQL databases that support the concept of a "get" by Primary Key rather than a "select".

The advantage of a "get" is that there is no SQL/CQL/OQL/whatever to parse or process, so it's much much faster.

Is there anything similar in the Cassandra API where I can simply "get" an entire row by primary key without Cassandra having to parse CQL? (Or is CQL parsing so simple and fast that it makes no measurable difference?)

1
"...so it's much much faster." Can you share your supporting metrics? - Don Branson
Well not for Cassandra, but for other NoSQL databases. Like GemFire, for example, is a super-fast memory grid, so a "get" takes about 0.1ms, but if you pass an OQL query, it takes 1 or 2 ms. That's still fast, but an order of magnitude slower than the "get", and for some workloads that can be critical. - Beaker
It can be critical. But does the same difference hold true for CQL? Have to measure it to know. - Don Branson

1 Answers

7
votes

CQL parsing is fast and low overhead, don't worry about it. If it bothers you you can prepare the statement and have them pre-parsed but network and disk latency will trump it by orders of magnitude.

There is a Thrift interface though if you really want a "get" function. Its deprecated now and in recent versions CQL is faster.