Unique (cost=1.06..1.10 rows=1 width=594) (actual time=845786.00..845786.00 rows=2 loops=1) -> Sort (cost=1.06..1.07 rows=1 width=594) (actual time=845786.00..845786.00 rows=2 loops=1) Sort Key: c.relname, a.attnum, n.nspname, n2.nspname, c2.relname, t.tgconstrname, ic.relname, t.tgdeferrable, t.tginitdeferred, t.tgnargs, t.tgargs, p1.proname, p2.proname -> Merge Join (cost=1.03..1.05 rows=1 width=594) (actual time=844522. 00..845786.00 rows=2 loops=1) Merge Cond: ("outer".tgconstrrelid = "inner".tgconstrrelid) Join Filter: (("inner".tgfoid = "outer".oid) AND ("inner".tgrelid = "outer".oid)) -> Nested Loop (cost=0.00..27709.41 rows=1 width=510) (actual time=844522.00..845786.00 rows=12 loops=1) Join Filter: (("inner".indexrelid = "outer".oid) AND ("inner".indrelid = "outer".oid)) -> Nested Loop (cost=0.00..27706.67 rows=1 width=502) (actual time=843375.00..843954.00 rows=10620 loops=1) Join Filter: (("inner".tgconstrrelid = "outer".oid) AND ("outer".relnamespace = "inner".oid)) -> Index Scan using pg_class_oid_index on pg_class c2 (cost=0.00..15.67 rows=1 width=72) (actual time=1.00..1.00 rows=1 loops=1) Filter: (relname = 'users'::name) -> Materialize (cost=27690.93..27690.93 rows=4 width=430) (actual time=843374.00..843781.00 rows=42480 loops=1) -> Nested Loop (cost=0.00..27690.93 rows=4 width=430) (actual time=614674.00..843125.00 rows=42480 loops=1) -> Nested Loop (cost=0.00..27689.85 rows=1 width=362) (actual time=614674.00..842368.00 rows=10620 loops=1) Join Filter: (("outer".tgfoid = "inner".oid) AND ("outer".tgrelid = "inner".oid)) -> Seq Scan on pg_trigger t1 (cost=0.00..1.02 rows=1 width=12) (actual time=0.00..1.00 rows=6 loops=1) Filter: tgisconstraint -> Materialize (cost=26180.37..26180.37 rows=100564 width=350) (actual time=83492.50..135359.33 rows=3637350 loops=6) -> Nested Loop (cost=0.00..26180.37 rows=100564 width=350) (actual time=68978.00..481414.00 rows=3637350 loops=1) Join Filter: ("inner".relnamespace = "outer".oid) -> Seq Scan on pg_namespace n (cost=0.00..1.04 rows=4 width=68) (actual time=0.00..0.00 rows=4 loops=1) -> Materialize (cost=5287.78..5287.78 rows=100564 width=282) (actual time=17273.75..110243.25 rows=3637350 loops=4) -> Nested Loop (cost=0.00..5287.78 rows=100564 width=282) (actual time=106.00..45489.00 rows=3637350 loops=1) -> Nested Loop (cost=0.00..843.50 rows=811 width=210) (actual time=106.00..557.00 rows=26550 loops=1) -> Index Scan using pg_proc_proname_args_nsp_index on pg_proc p2 (cost=0.00..5.97 rows=1 width=68) (actual time=0.00..1.00 rows=5 loops=1) Index Cond: ((proname >= 'RI'::name) AND (proname < 'RJ'::name)) Filter: (proname ~~ 'RI_FKey_%_del'::text) -> Materialize (cost=829.42..829.42 rows=811 width=142) (actual time=21.20..58.60 rows=5310 loops=5) -> Merge Join (cost=0.00..829.42 rows=811 width=142) (actual time=0.00..87.00 rows=5310 loops=1) Merge Cond: ("outer".oid = "inner".attrelid) -> Nested Loop (cost=0.00..757.44 rows=124 width=136) (actual time=0.00..27.00 rows=822 loops=1) -> Index Scan using pg_class_oid_index on pg_class ic (cost=0.00..15.36 rows=124 width=68) (actual time=0.00..1.00 rows=137 loops=1) -> Index Scan using pg_proc_proname_args_nsp_index on pg_proc p1 (cost=0.00..5.97 rows=1 width=68) (actual time=0.00..0.17 rows=6 loops=137) Index Cond: ((proname >= 'RI'::name) AND (proname < 'RJ'::name)) Filter: (proname ~~ 'RI_FKey_%_upd'::text) -> Index Scan using pg_attribute_relid_attnum_index on pg_attribute a (cost=0.00..59.51 rows=811 width=6) (actual time=0.00..32.00 rows=5305 loops=1) -> Seq Scan on pg_class c (cost=0.00..4.24 rows=124 width=72) (actual time=0.01..0.96 rows=137 loops=26550) -> Seq Scan on pg_namespace n2 (cost=0.00..1.04 rows=4 width=68) (actual time=0.01..0.02 rows=4 loops=10620) -> Seq Scan on pg_index i (cost=0.00..2.61 rows=9 width=8) (actual time=0.06..0.14 rows=15 loops=10620) Filter: indisprimary -> Sort (cost=1.03..1.03 rows=1 width=84) (actual time=0.00..0.00 rows=39 loops=1) Sort Key: t.tgconstrrelid -> Seq Scan on pg_trigger t (cost=0.00..1.02 rows=1 width=84) (actual time=0.00..0.00 rows=6 loops=1) Filter: tgisconstraint Total runtime: 845941.00 msec (46 rows)