Francisco Correia
03/10/2023, 1:02 AMselect * from relation_tuple WHERE (namespace, object_id, relation, userset_namespace, userset_object_id, userset_relation, created_transaction, deleted_transaction) IN (SELECT namespace, object_id, relation, userset_namespace, userset_object_id, userset_relation, created_transaction, deleted_transaction FROM relation_tuple WHERE created_xid IS NULL LIMIT 1000);
shows me an execution time of 20 second per migration update step with limit 1000 (so that would take a very long time to finish...). Anyone seen anything similar or any advice?jzelinskie
03/10/2023, 10:20 PMJoey
03/10/2023, 10:46 PMEXPLAIN ANALYZE
on the query might yield some insightsFrancisco Correia
03/11/2023, 5:30 PMIndex Scan using ix_relation_tuple_by_subject
is the one that seems to be taking way too long. I posted the picture of the migration query and an equivalent formulation using a join instead of an IN.