https://authzed.com logo
#spicedb
Title
# spicedb
w

williamdclt

03/24/2022, 4:12 PM
The garbage collection on my Postgres datastore is timing out with the default settings. I can tune the settings, but a few questions: First, the query seems to be
WITH rows AS (SELECT id FROM relation_tuple WHERE deleted_transaction <= $1) DELETE FROM relation_tuple WHERE id IN (SELECT id FROM rows);
. Why not
DELETE FROM relation_tuple WHERE deleted_transaction <= $1
? Second, there's no index on that table that PG can use for this query. PG will have to do a seq scan on the table, is there a reason behind the absence of index? In my case (20M relationships in database), such a seq scan takes 2 full minutes