QUERY PLAN
Sort (cost=99779.84..99779.84 rows=1 width=322)
Sort Key: fns.nspname, fc.relname, a.attnum
-> Nested Loop Left Join (cost=12.47..99779.83 rows=1 width=322)
-> Nested Loop Left Join (cost=12.18..99779.52 rows=1 width=289)
Join Filter: (fc.relnamespace = fns.oid)
-> Nested Loop Left Join (cost=12.18..99778.34 rows=1 width=229)
Join Filter: (fc.oid = ct.confrelid)
-> Nested Loop (cost=12.18..99214.36 rows=1 width=161)
Join Filter: (c.oid = a.attrelid)
-> Nested Loop (cost=11.89..99214.03 rows=1 width=126)
Join Filter: (c.relnamespace = ns.oid)
-> Seq Scan on pg_namespace ns (cost=0.00..1.10 rows=1 width=4)
Filter: (nspname = 'global'::name)
-> Hash Join (cost=11.89..99212.83 rows=8 width=130)
Hash Cond: (ct.conrelid = c.oid)
-> ProjectSet (cost=0.00..28399.90 rows=5608000 width=123)
-> Seq Scan on pg_constraint ct (cost=0.00..317.84 rows=5608 width=118)
Filter: (contype = 'f'::"char")
-> Hash (cost=11.86..11.86 rows=2 width=8)
-> Bitmap Heap Scan on pg_class c (cost=4.30..11.86 rows=2 width=8)
Recheck Cond: (relname = 'tbl_api_log'::name)
-> Bitmap Index Scan on pg_class_relname_nsp_index (cost=0.00..4.30 rows=2 width=0)
Index Cond: (relname = 'tbl_api_log'::name)
-> Index Scan using pg_attribute_relid_attnum_index on pg_attribute a (cost=0.29..0.31 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..438.99 rows=9999 width=72)
-> Seq Scan on pg_namespace fns (cost=0.00..1.08 rows=8 width=68)
-> Index Scan using pg_attribute_relid_attnum_index on pg_attribute fa (cost=0.29..0.31 rows=1 width=70)
Index Cond: ((attrelid = ct.confrelid) AND (attnum = (ct.confkey)[(generate_subscripts(ct.conkey, 1))]))