Hi team,
Are active and archived contracts on the same table in Canton-on-postgres context ?
We are trying to understand whether archiving a huge amount of contracts would affect the performance…
Thanks and Regards,
Jean-Paul
Hi team,
Are active and archived contracts on the same table in Canton-on-postgres context ?
We are trying to understand whether archiving a huge amount of contracts would affect the performance…
Thanks and Regards,
Jean-Paul
Hi Jean-Paul
There are two tables relevant here:
The contracts
table stores contract data. No change, if you archive a contract. If you prune the participant, the data of archived contracts will be deleted, if the contract has been archived before the pruning threshold.
canton/V1_1__initial.sql at 04cab0f2296f98baaafc6478f208a9621bba7d1f · digital-asset/canton · GitHub
The active_contracts
table stores the state of a contract (active, archived, transferred away). If you archive a contract, a new line will be appended to this table. If you prune, the lines referring to contracts archived before the pruning threshold will be removed.
canton/V1_1__initial.sql at 04cab0f2296f98baaafc6478f208a9621bba7d1f · digital-asset/canton · GitHub
Overall, if you have a huge number of archived contracts, reading from these tables will slow down. But it should only slow down by O(log(#contracts))
, due to the indices on these tables.
Hope that answers your question.
Matthias