liveBook · Manning

WRITETIME function

As explained in ScyllaDB in Action

The WRITETIME function is a CQL function that returns the write timestamp associated with a non-primary-key column value.

WRITETIME is a CQL function that returns the write timestamp attached to a non-primary-key column value. It helps inspect which write ScyllaDB uses when concurrent operations affect the same cell. section 6.1.2 section 6.6

Compare timestamps for an author

Query Alice Author’s row with SELECT id, WRITETIME(name), WRITETIME(bio) FROM authors WHERE id = ...;. The returned timestamps show that bio was written later than name, reflecting the later update. section 6.1.2

Use WRITETIME to inspect cell-level write ordering, while remembering:

  • Each non-primary-key value receives a timestamp, and newer timestamps take precedence when writes are reconciled. section 6.1.2
  • WRITETIME reports timestamps; USING TIMESTAMP controls them, but explicit timestamps are intended for specific cases such as data migrations. section 6.1.2

How ScyllaDB in Action covers it

How deep it goes
Explains the function through a SELECT example and connects results to last-write-wins, without covering implementation internals.
Examples
Uses an authors query comparing Alice Author’s name and bio timestamps.
What it assumes
Assumes familiarity with CQL SELECT queries, rows, columns, and primary keys.
What you can do after
Diagnose concurrent updates by querying and comparing timestamps for individual column values.
How it connects
Connects WRITETIME to write timestamps, concurrent operations, last-write-wins reconciliation, and USING TIMESTAMP.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.