CHANGES reads only the
rows appended to a table since an earlier
version, so a recurring job can scope itself
to what is new.
Example data
curation_batches gets a batch of new documents appended periodically, with
no updates or deletes between appends:
Read only what is new
CHANGES (INFORMATION => APPEND_ONLY) AT (VERSION => 5) reads the rows
appended after version 5 — documents 3 and 4 — without rescanning 1 and 2:
CHANGES from it. See Versioning for
the APIs that read a table’s current version.
Chain it into a curation task
CHANGES is a relation, like any other table reference, so it composes with
the rest of this page: chunk, dedupe, or join only the new rows, instead of
the whole table. Materializing the result keeps a running, append-only table
of work already done:
dedupe
call works the same way: put the CHANGES relation where the source table
would otherwise go, and only the new rows flow through it.
Strictly append-only
The clause is named for what it requires, not just what it does. If anything other than a pure append happened to the table between the starting version and the current one — an update, a delete, a merge — the query is refused rather than silently returning an incomplete or wrong result:What to read next
CHANGES
The full SQL syntax, placement rules, and unsupported forms.
Table
How table versions work, and how to find one to start from.