79097985

Date: 2024-10-17 12:08:42
Score: 0.5
Natty:
Report link

Row level modification timestamp is not available in the information_schema views currently.

However, there is a column LAST_ALTERED in the SNOWFLAKE.ACCOUNT_USAGE.TABLES view that gives the Date and time when the table was last altered by a DDL or DML operation.

For the specific requirement you have shared as part of the example, you may consider implementing a stream.

Standard stream (also known as Delta stream) should do. The catch with Standard streams is it performs a join on inserted and deleted rows in the change set to provide the row level delta. As a net effect, for example, a row that is inserted and then deleted between two transactional points of time in a table is removed in the delta (i.e. is not returned when the stream is queried).

If there is a requirement to track each and every single modification to every row, then we could consider implementing a combination of two streams - a Standard stream and an Append Only stream.

An append-only stream exclusively tracks row inserts. Update, delete, and truncate operations are not captured by append-only streams. For instance, if 10 rows are initially inserted into a table, and then 5 of those rows are deleted before advancing the offset for an append-only stream, the stream would only record the 10 inserted rows.

Reference: https://docs.snowflake.com/en/user-guide/streams-intro

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Suraj Ganiga