When a query uses a statement which makes a change to ThingsDB, then internally ThingsDB will create a change with a new change-Id to apply these transformations. Changes are applied in order on each node; so database consistency is guaranteed.
A single query might contain several statements and make many changes. All changes within a query will be grouped in a single change with the exception of future callbacks. Each future callback will get its own change-Id if a change is required (see the future type for more info on futures).