QUERY PLAN
Sort (cost=23051.60..23051.60 rows=1 width=322)
Sort Key: fns.nspname, fc.relname, a.attnum
-> Nested Loop Left Join (cost=9.26..23051.59 rows=1 width=322)
-> Nested Loop Left Join (cost=8.85..23051.15 rows=1 width=289)
Join Filter: (fc.relnamespace = fns.oid)
-> Nested Loop Left Join (cost=8.85..23049.81 rows=1 width=229)
Join Filter: (fc.oid = ct.confrelid)
-> Nested Loop (cost=8.85..22887.97 rows=1 width=161)
Join Filter: (c.oid = a.attrelid)
-> Nested Loop (cost=8.43..22887.52 rows=1 width=126)
Join Filter: (c.relnamespace = ns.oid)
-> Seq Scan on pg_namespace ns (cost=0.00..1.19 rows=1 width=4)
Filter: (nspname = 'global'::name)
-> Hash Join (cost=8.43..22886.29 rows=4 width=130)
Hash Cond: (ct.conrelid = c.oid)
-> ProjectSet (cost=0.00..6642.06 rows=1286000 width=123)
-> Seq Scan on pg_constraint ct (cost=0.00..202.41 rows=1286 width=118)
Filter: (contype = 'f'::"char")
-> Hash (cost=8.42..8.42 rows=1 width=8)
-> Index Scan using pg_class_relname_nsp_index on pg_class c (cost=0.41..8.42 rows=1 width=8)
Index Cond: (relname = 'tbl_registrations'::name)
-> Index Scan using pg_attribute_relid_attnum_index on pg_attribute a (cost=0.41..0.44 rows=1 width=70)
Index Cond: ((attrelid = ct.conrelid) AND (attnum = (ct.conkey)[(generate_subscripts(ct.conkey, 1))]))
-> Seq Scan on pg_class fc (cost=0.00..124.15 rows=3015 width=72)
-> Seq Scan on pg_namespace fns (cost=0.00..1.15 rows=15 width=68)
-> Index Scan using pg_attribute_relid_attnum_index on pg_attribute fa (cost=0.41..0.44 rows=1 width=70)
Index Cond: ((attrelid = ct.confrelid) AND (attnum = (ct.confkey)[(generate_subscripts(ct.conkey, 1))]))