           (apply str
                  "INSERT INTO temp.tx_lookup_after (e0, a0, v0, tx0, added0, value_type_tag0, sv, svalue_type_tag,
                   rid, e, a, v, tx, value_type_tag)
-                  SELECT e, a, v, ?, 0 + 2, value_type_tag, v, value_type_tag,
+                  SELECT e, a, v, ?, 0, value_type_tag, v, value_type_tag,
                   rowid, e, a, v, ?, value_type_tag
                   FROM datoms
                   WHERE "

        ;; Second is slower, but still only one table walk: lookup old value by ea.
        insert-into-tx-lookup
        ["INSERT INTO temp.tx_lookup_after
          SELECT t.e0, t.a0, t.v0, t.tx0, t.added0 + 2, t.value_type_tag0, t.index_avet0, t.index_vaet0, t.index_fulltext0, t.unique_value0, t.sv, t.svalue_type_tag, d.rowid, d.e, d.a, d.v, d.tx, d.value_type_tag
          FROM temp.tx_lookup_before AS t
          LEFT JOIN datoms AS d
          ON t.e0 = d.e AND

          (apply str
                 "INSERT INTO temp.tx_lookup_after (e0, a0, v0, tx0, added0, value_type_tag0, sv, svalue_type_tag,
                  rid, e, a, v, tx, value_type_tag)
                  SELECT e, a, v, ?, 0, value_type_tag, v, value_type_tag,
                  rowid, e, a, v, ?, value_type_tag
                  FROM datoms
                  WHERE "
