 			seq_scan = tu.seq_scan + buf.seq_scan,
 			seq_tup_read = tu.seq_tup_read + buf.seq_tup_read,
 			idx_scan = tu.idx_scan + buf.idx_scan,
-			idx_tup_read = tu.idx_tup_read + buf.idx_tup_read
+			idx_tup_read = tu.idx_tup_read + buf.idx_tup_read,
+			n_tup_ins = tu.n_tup_ins + buf.n_tup_ins,
+			n_tup_upd = tu.n_tup_upd + buf.n_tup_upd,
+			n_tup_del = tu.n_tup_del + buf.n_tup_del
 		FROM
 			GroupedBuffers buf
 		WHERE

		WHERE
			CallGraphBufferID = ANY(_.CallGraphBufferIDs)
		RETURNING
			relid, seq_scan, seq_tup_read, idx_scan, idx_tup_read
	),
	GroupedBuffers AS (
		SELECT
			relid, sum(seq_scan) AS seq_scan, sum(seq_tup_read) AS seq_tup_read,
				   sum(idx_scan) AS idx_scan, sum(idx_tup_read) AS idx_tup_read
		FROM
			Buffers
		GROUP BY

			tu.relid = buf.relid
	)
	INSERT INTO
		TableUsage (CallGraphID, relid, seq_scan, seq_tup_read, idx_scan, idx_tup_read,
										n_tup_ins, n_tup_upd, n_tup_del)
	SELECT
		_CallGraphID, relid, seq_scan, seq_tup_read, idx_scan, idx_tup_read,
							 n_tup_ins, n_tup_upd, n_tup_del
	FROM
		GroupedBuffers buf
	WHERE
