Cassandra: know when the row got inserted

Viewed 33

Small question regarding Cassandra please.

I have a row, I can see it in Cassandra, I can query it etc. The row looks like this.

CREATE TABLE student_Registration(
Id int PRIMARY KEY,
Name text,
Event text
);

Id  Name    Event
101 Ashish  Ninza

I would like to ask, is there a way to know when this row got inserted please? I tried looking up for some command to get the insert time, similar to SELECT TTL (Name) from, but for "when the row got inserted" and no luck so far.

May I ask what would be the best way to know when the row got inserted please?

Thank you

1 Answers

That's the responsibility of the writetime function (doc):

SELECT writetime(Name) from student_Registration

Update: But you need to keep in mind following:

  1. the writetime shows the update time of the individual cell, and they could be updated separately

  2. Write time could be setup explicitly when writing the data

Related