Nested Loop (cost=0.68..14.51 rows=1 width=64) -> Nested Loop Semi Join (cost=0.55..14.32 rows=1 width=72) -> Nested Loop (cost=0.27..12.72 rows=1 width=80) -> Seq Scan on pg_constraint r (cost=0.00..4.39 rows=1 width=72) Filter: (contype = 'f'::"char") -> Index Scan using pg_class_oid_index on pg_class tc (cost=0.27..8.29 rows=1 width=8) Index Cond: (oid = r.conrelid) -> Nested Loop (cost=0.27..1.60 rows=1 width=4) Join Filter: (c.relnamespace = n.oid) -> Index Scan using pg_class_oid_index on pg_class c (cost=0.27..0.47 rows=1 width=8) Index Cond: (oid = tc.oid) Filter: (relname = 'doctrine_migration_versions'::name) -> Seq Scan on pg_namespace n (cost=0.00..1.11 rows=1 width=4) Filter: ((nspname <> ALL ('{pg_catalog,information_schema,pg_toast}'::name[])) AND (nspname = ANY (current_schemas(false)))) -> Index Only Scan using pg_namespace_oid_index on pg_namespace tn (cost=0.13..0.17 rows=1 width=4) Index Cond: (oid = tc.relnamespace)