<p>Snapshots use the default db-sync flavour, which doesn't enable the <code>--consumed-tx-out</code> flag. This flag creates the <code>tx_out.consumed_by_tx_id</code> column. Also for each <code>tx_in</code> entry it updates exactly one <code>tx_out.consumed_by_tx_id</code> field. The fact that there are so many updates and that postgres is not really optimised for updates makes this process very slow. Also note this flag eventually drops all <code>tx_in</code> entries, since they become redundant.</p>

CC BY-SA 4.0
2024-02-01T19:10:11.773Z
2024-02-01T19:10:11.773Z
Kostas Dermentzis
<p>Interested to understand why db sync snap shot does not include new consumed_tx_out column.  Just upgraded to v3.1.1.3 using manual method (not docker) and restored most recent db snapshot from 4 days ago with the hope that these &quot;fix&quot; items would already be included.  Why is this not the case?  Also, what are the controls (non docker) for telling db sync &quot;when to run&quot; or &quot;when not to run&quot; these fix commands?  Perhaps I overlooked the documentation for this.</p>
<p>Thank you</p>

CC BY-SA 4.0
2024-02-01T14:41:02.400Z
I am going to re-restore from the latest snapshot and attempt to start and sync the db sync node without "--consumed-tx-out" flag in run command.  Seems as though the script used to process the consumed-tx-out update needs some more work.
Nicholas
<cardano-db-sync>
DB Sync Upgrade to v 3.1.1.3 snapshot restore (4 days old) running "extra migration consumed_tx_out". Why is new column not included in snapshot?
# DB Sync Upgrade to v 3.1.1.3 snapshot restore (4 days old) running "extra migration consumed_tx_out". Why is new column not included in snapshot?

(Asked by: username_0 on 2024-02-01)

Interested to understand why db sync snap shot does not include new consumed\_tx\_out column. Just upgraded to v3.1.1.3 using manual method (not docker) and restored most recent db snapshot from 4 days ago with the hope that these "fix" items would already be included. Why is this not the case? Also, what are the controls (non docker) for telling db sync "when to run" or "when not to run" these fix commands? Perhaps I overlooked the documentation for this.

Thank you

**Tags:** cardano-db-sync
> **Comments:**
> **username_0**: I am going to re-restore from the latest snapshot and attempt to start and sync the db sync node without "--consumed-tx-out" flag in run command.  Seems as though the script used to process the consumed-tx-out update needs some more work.  

---

## 1 answers

### Answer by username_1 on 2024-02-01. Score: 1

Snapshots use the default db-sync flavour, which doesn't enable the `--consumed-tx-out` flag. This flag creates the `tx_out.consumed_by_tx_id` column. Also for each `tx_in` entry it updates exactly one `tx_out.consumed_by_tx_id` field. The fact that there are so many updates and that postgres is not really optimised for updates makes this process very slow. Also note this flag eventually drops all `tx_in` entries, since they become redundant.


---

