Database Reference
In-Depth Information
Introspecting write timestamps
As it turns out, CQL gives us a mechanism for finding out when a particular column was
last written. This is done using the
WRITETIME
function. Let's say we're interested in the
write timestamps for the email and
location
fields in HappyCorp's user record:
SELECT "email", WRITETIME("email"),
"location", WRITETIME("location")
FROM "users"
WHERE "username" = 'happycorp';
We'll see that Cassandra gives us the write times of each column formatted as micro-
seconds since the UNIX epoch:
Note that the timestamps are different: we initially wrote the email address when we cre-
ated HappyCorp's record and later updated the row to have a location.
Note
For more information on timestamp introspection in Cassandra, see the DataStax CQL doc-