Unique (cost=4271.07..4271.08 rows=1 width=1370) (actual time=369032.656..369037.280 rows=5000 loops=1) CTE cte_contacts -> Unique (cost=1865.00..1865.13 rows=26 width=8) (actual time=485.087..489.009 rows=5000 loops=1) -> Sort (cost=1865.00..1865.07 rows=26 width=8) (actual time=485.086..486.234 rows=5000 loops=1) Sort Key: c.contactid Sort Method: quicksort Memory: 427kB -> Nested Loop (cost=41.50..1864.39 rows=26 width=8) (actual time=35.338..480.995 rows=5000 loops=1) Join Filter: (cd.contenttypeid = ct.contenttypeid) -> Nested Loop (cost=41.50..1862.18 rows=26 width=10) (actual time=35.318..465.963 rows=5000 loops=1) -> Nested Loop (cost=41.50..1145.37 rows=26 width=16) (actual time=35.226..366.942 rows=5000 loops=1) -> Nested Loop (cost=41.50..984.32 rows=26 width=20) (actual time=35.213..125.133 rows=5000 loops=1) -> Hash Left Join (cost=41.50..267.52 rows=26 width=8) (actual time=35.121..61.289 rows=5000 loops=1) Hash Cond: (a.progresscounter = g.progresscounter) Filter: (g.contactid IS NULL) -> Index Scan using activemailings_0000230_pc_idx on activemailings_0000230 a (cost=0.00..192.24 rows=5275 width=12) (actual time=35.028..55.868 rows=5000 loops=1) Index Cond: ((progresscounter >= 515000) AND (progresscounter <= 519999)) -> Hash (cost=24.00..24.00 rows=1400 width=12) (actual time=0.027..0.027 rows=1 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 1kB -> Seq Scan on activemailingsgenerated_0000230 g (cost=0.00..24.00 rows=1400 width=12) (actual time=0.020..0.021 rows=1 loops=1) -> Index Scan using idx_contacts1 on contacts c (cost=0.00..27.56 rows=1 width=12) (actual time=0.011..0.011 rows=1 loops=5000) Index Cond: (c.contactid = a.contactid) -> Index Scan using domains_pkey on domains d (cost=0.00..6.18 rows=1 width=4) (actual time=0.047..0.047 rows=1 loops=5000) Index Cond: (d.domainid = c.domainid) -> Index Scan using contactdetails_pkey on contactdetails cd (cost=0.00..27.56 rows=1 width=10) (actual time=0.017..0.018 rows=1 loops=5000) Index Cond: (cd.contactid = c.contactid) -> Materialize (cost=0.00..1.04 rows=3 width=2) (actual time=0.000..0.001 rows=3 loops=5000) -> Seq Scan on contenttypes ct (cost=0.00..1.03 rows=3 width=2) (actual time=0.009..0.010 rows=3 loops=1) -> Sort (cost=2405.94..2405.94 rows=1 width=1370) (actual time=369032.654..369033.741 rows=5000 loops=1) Sort Key: am.progresscounter, cd.contactid Sort Method: quicksort Memory: 1521kB -> Nested Loop Left Join (cost=1.75..2405.93 rows=1 width=1370) (actual time=616.017..369009.240 rows=5000 loops=1) Join Filter: (contacts.contactid = cd.contactid) -> Nested Loop (cost=1.17..257.80 rows=1 width=1360) (actual time=538.120..7806.007 rows=5000 loops=1) -> Nested Loop (cost=1.17..250.52 rows=1 width=1388) (actual time=511.913..7476.828 rows=5000 loops=1) Join Filter: (cd.contenttypeid = ct.contenttypeid) -> Nested Loop (cost=1.17..249.45 rows=1 width=1226) (actual time=511.901..7433.186 rows=5000 loops=1) -> Nested Loop (cost=1.17..221.87 rows=1 width=104) (actual time=511.884..7375.435 rows=5000 loops=1) -> Nested Loop (cost=1.17..215.47 rows=1 width=89) (actual time=511.874..7339.516 rows=5000 loops=1) -> Nested Loop (cost=1.17..187.89 rows=1 width=64) (actual time=511.855..7296.137 rows=5000 loops=1) Join Filter: (am.contactid = cte_contacts.id) -> HashAggregate (cost=0.58..0.84 rows=26 width=8) (actual time=495.631..501.471 rows=5000 loops=1) -> CTE Scan on cte_contacts (cost=0.00..0.52 rows=26 width=8) (actual time=485.090..491.975 rows=5000 loops=1) -> Materialize (cost=0.58..176.97 rows=26 width=56) (actual time=0.003..0.499 rows=5000 loops=5000) -> Nested Loop (cost=0.58..176.84 rows=26 width=56) (actual time=16.213..95.466 rows=5000 loops=1) -> HashAggregate (cost=0.58..0.84 rows=26 width=8) (actual time=5.094..8.226 rows=5000 loops=1) -> CTE Scan on cte_contacts (cost=0.00..0.52 rows=26 width=8) (actual time=0.004..1.472 rows=5000 loops=1) -> Index Scan using activemailings_0000230_c_idx on activemailings_0000230 am (cost=0.00..6.76 rows=1 width=48) (actual time=0.016..0.016 rows=1 loops=5000) Index Cond: (am.contactid = cte_contacts.id) -> Index Scan using idx_contacts1 on contacts c (cost=0.00..27.57 rows=1 width=25) (actual time=0.006..0.007 rows=1 loops=5000) Index Cond: (c.contactid = am.contactid) Filter: (c.statusid = 1) -> Index Scan using domains_pkey on domains d (cost=0.00..6.38 rows=1 width=19) (actual time=0.005..0.005 rows=1 loops=5000) Index Cond: (d.domainid = c.domainid) -> Index Scan using contactdetails_pkey on contactdetails cd (cost=0.00..27.57 rows=1 width=1122) (actual time=0.009..0.010 rows=1 loops=5000) Index Cond: (cd.contactid = c.contactid) -> Seq Scan on contenttypes ct (cost=0.00..1.03 rows=3 width=164) (actual time=0.001..0.002 rows=3 loops=5000) -> Index Scan using idx_tagdetails1 on tagdetails (cost=0.00..7.27 rows=1 width=12) (actual time=0.063..0.064 rows=1 loops=5000) Index Cond: (tagdetails.contactid = cd.contactid) Filter: ((tagdetails.tagid IS NOT NULL) AND (tagdetails.tagid = 13)) -> Nested Loop Left Join (cost=0.58..2147.79 rows=26 width=18) (actual time=0.032..71.270 rows=5000 loops=5000) -> Nested Loop Left Join (cost=0.58..1432.84 rows=26 width=12) (actual time=0.020..45.707 rows=5000 loops=5000) -> Nested Loop (cost=0.58..718.03 rows=26 width=8) (actual time=0.006..23.370 rows=5000 loops=5000) -> HashAggregate (cost=0.58..0.84 rows=26 width=8) (actual time=0.002..1.443 rows=5000 loops=5000) -> CTE Scan on cte_contacts (cost=0.00..0.52 rows=26 width=8) (actual time=0.002..1.431 rows=5000 loops=1) -> Index Scan using idx_contacts1 on contacts (cost=0.00..27.57 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=25000000) Index Cond: (contacts.contactid = cte_contacts.id) -> Index Scan using subscriber_map_contactid_idx on subscriber_map (cost=0.00..27.48 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=25000000) Index Cond: (contacts.contactid = subscriber_map.contactid) -> Index Scan using mw_subscriber_subscriberid_idx on mw_subscriber (cost=0.00..27.49 rows=1 width=14) (actual time=0.004..0.004 rows=1 loops=25000000) Index Cond: (subscriber_map.subscriberid = mw_subscriber.subscriberid)