Unique (cost=4101.93..4101.94 rows=1 width=1370) (actual time=4364.751..4368.303 rows=5000 loops=1) CTE cte_contacts -> Unique (cost=1795.10..1795.22 rows=25 width=8) (actual time=811.605..815.486 rows=5000 loops=1) -> Sort (cost=1795.10..1795.16 rows=25 width=8) (actual time=811.604..812.618 rows=5000 loops=1) Sort Key: c.contactid Sort Method: quicksort Memory: 427kB -> Nested Loop (cost=41.50..1794.52 rows=25 width=8) (actual time=34.992..807.514 rows=5000 loops=1) -> Nested Loop (cost=41.50..1639.66 rows=25 width=12) (actual time=34.978..210.534 rows=5000 loops=1) -> Nested Loop (cost=41.50..950.43 rows=25 width=16) (actual time=34.893..148.094 rows=5000 loops=1) Join Filter: (cd.contenttypeid = ct.contenttypeid) -> Nested Loop (cost=41.50..948.27 rows=25 width=18) (actual time=34.873..132.554 rows=5000 loops=1) -> Hash Left Join (cost=41.50..259.01 rows=25 width=8) (actual time=34.785..45.214 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..184.44 rows=5085 width=12) (act ual time=22.838..28.119 rows=5000 loops=1) Index Cond: ((progresscounter >= 415000) AND (progresscounter <= 419999)) -> Hash (cost=24.00..24.00 rows=1400 width=12) (actual time=11.895..11.895 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=11.884..11.885 rows=1 loops=1) -> Index Scan using contactdetails_pkey on contactdetails cd (cost=0.00..27.56 rows=1 width=10) (actual time=0.015..0.016 rows= 1 loops=5000) Index Cond: (cd.contactid = a.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.010..0.012 rows=3 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 = cd.contactid) -> Index Scan using domains_pkey on domains d (cost=0.00..6.18 rows=1 width=4) (actual time=0.117..0.118 rows=1 loops=5000) Index Cond: (d.domainid = c.domainid) -> Sort (cost=2306.71..2306.71 rows=1 width=1370) (actual time=4364.749..4365.398 rows=5000 loops=1) Sort Key: am.progresscounter, cd.contactid Sort Method: quicksort Memory: 1521kB -> Hash Left Join (cost=2067.18..2306.70 rows=1 width=1370) (actual time=4154.976..4354.979 rows=5000 loops=1) Hash Cond: (cd.contactid = contacts.contactid) -> Nested Loop (cost=1.69..241.18 rows=1 width=1360) (actual time=879.632..1069.496 rows=5000 loops=1) -> Nested Loop (cost=1.69..233.90 rows=1 width=1388) (actual time=858.193..1016.353 rows=5000 loops=1) Join Filter: (cd.contenttypeid = ct.contenttypeid) -> Nested Loop (cost=1.69..232.83 rows=1 width=1226) (actual time=858.179..995.615 rows=5000 loops=1) -> Nested Loop (cost=1.69..205.25 rows=1 width=104) (actual time=858.163..958.404 rows=5000 loops=1) -> Nested Loop (cost=1.69..198.85 rows=1 width=89) (actual time=858.152..933.784 rows=5000 loops=1) -> Hash Join (cost=1.69..171.26 rows=1 width=64) (actual time=858.127..897.187 rows=5000 loops=1) Hash Cond: (am.contactid = cte_contacts.id) -> Nested Loop (cost=0.56..170.04 rows=25 width=56) (actual time=848.757..881.732 rows=5000 loops=1) -> HashAggregate (cost=0.56..0.81 rows=25 width=8) (actual time=822.087..825.069 rows=5000 loops=1) -> CTE Scan on cte_contacts (cost=0.00..0.50 rows=25 width=8) (actual time=811.609..818.588 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.010..0.010 rows=1 loops=5000) Index Cond: (am.contactid = cte_contacts.id) -> Hash (cost=0.81..0.81 rows=25 width=8) (actual time=9.340..9.340 rows=5000 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 196kB -> HashAggregate (cost=0.56..0.81 rows=25 width=8) (actual time=5.037..6.903 rows=5000 loops=1) -> CTE Scan on cte_contacts (cost=0.00..0.50 rows=25 width=8) (actual time=0.001..1.451 rows=5000 loops=1) -> Index Scan using idx_contacts1 on contacts c (cost=0.00..27.57 rows=1 width=25) (actual time=0.006..0.006 rows=1 loops=5000) Index Cond: (c.contactid = cte_contacts.id) Filter: (c.statusid = 1) -> Index Scan using domains_pkey on domains d (cost=0.00..6.38 rows=1 width=19) (actual time=0.004..0.004 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.006..0.006 rows=1 loops=5000) Index Cond: (cd.contactid = cte_contacts.id) -> Seq Scan on contenttypes ct (cost=0.00..1.03 rows=3 width=164) (actual time=0.001..0.001 rows=3 loops=5000) -> Index Scan using idx_tagdetails1 on tagdetails (cost=0.00..7.27 rows=1 width=12) (actual time=0.009..0.010 rows=1 loops=5000) Index Cond: (tagdetails.contactid = cte_contacts.id) Filter: ((tagdetails.tagid IS NOT NULL) AND (tagdetails.tagid = 13)) -> Hash (cost=2065.18..2065.18 rows=25 width=18) (actual time=3275.289..3275.289 rows=5000 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 249kB -> Nested Loop Left Join (cost=0.56..2065.18 rows=25 width=18) (actual time=42.041..3267.321 rows=5000 loops=1) -> Nested Loop Left Join (cost=0.56..1377.73 rows=25 width=12) (actual time=29.429..3120.531 rows=5000 loops=1) -> Nested Loop (cost=0.56..690.41 rows=25 width=8) (actual time=5.126..64.963 rows=5000 loops=1) -> HashAggregate (cost=0.56..0.81 rows=25 width=8) (actual time=5.110..9.553 rows=5000 loops=1) -> CTE Scan on cte_contacts (cost=0.00..0.50 rows=25 width=8) (actual time=0.002..1.447 rows=5000 loops=1) -> Index Scan using idx_contacts1 on contacts (cost=0.00..27.57 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=5000) 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.609..0.610 rows=1 loops=5000) 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.026..0.027 rows=1 loops=5000) Index Cond: (subscriber_map.subscriberid = mw_subscriber.subscriberid) Total runtime: 4369.824 ms