I'm using spicedb with postgres database, I've noticed that when I delete a Relation the corresponding tuple is left in the relation_tuple
table and the value of the column deleted_xid
is set to transaction id.
Are those records to remain there forever? When will they be actually deleted?
I'm worrying that in a relative short time the table will be clogged with useless records...
In order to implement "time-traveling queries", SpiceDB's Postgres datastore implementation actually retains data for a period of time after deletion.
How long this data is available, how often garbage collection is conducted, and how long until garbage collection times out are all configurable.
From the
spicedb serve --help
usage:If you're curious, you can dive deeper into the implementation by reading this particular file: https://github.com/authzed/spicedb/blob/v1.25.0/internal/datastore/postgres/gc.go