Francisco Correia03/10/2023, 1:02 AM
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?
select * 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);
jzelinskie03/10/2023, 10:20 PM
Joey03/10/2023, 10:46 PM
on the query might yield some insights
Francisco Correia03/11/2023, 5:30 PM
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.
Index Scan using ix_relation_tuple_by_subject