You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Steven Haar <sh...@vintagesoftware.com> on 2010/06/11 18:49:52 UTC

Timestamp of an entire row?

What is the best way to determine the timestamp of a row (ie. the most
recent time when any of the columns of a row were modified).

Correct me if I am wrong, but I beleive a row does not have a timestamp,
only individual columns have timestamps.

So for instance if I need to know when a row was last modified, would I have
to perform a get_slice and get all columns pertaining to that row, and then
iterate through the columns to see which timestamp is the greatest(most
recent).



Thanks in advance for your help.

Re: Timestamp of an entire row?

Posted by Sylvain Lebresne <sy...@yakaz.com>.
> Correct me if I am wrong, but I beleive a row does not have a timestamp,
> only individual columns have timestamps.

You are correct

> So for instance if I need to know when a row was last modified, would I have
> to perform a get_slice and get all columns pertaining to that row, and then
> iterate through the columns to see which timestamp is the greatest(most
> recent).

If you do this reasonably often it is probably much more efficient to
use one column
per row (you name it "lastModicationTime" or something alike) and make
it contains
the timestamp of the last modification. It means you'll have to update
this on each
write in the row (with the current time) but Cassandra is fast on write.

--
Sylvain