explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l1eP

Settings
# exclusive inclusive rows x rows loops node
1. 0.469 53.153 ↓ 186.0 186 1

WindowAgg (cost=116.43..6,006.81 rows=1 width=849) (actual time=52.983..53.153 rows=186 loops=1)

2. 0.031 52.684 ↓ 186.0 186 1

Nested Loop Left Join (cost=116.43..6,006.79 rows=1 width=490) (actual time=1.521..52.684 rows=186 loops=1)

3. 0.109 50.607 ↓ 186.0 186 1

Nested Loop (cost=115.19..5,981.45 rows=1 width=442) (actual time=1.486..50.607 rows=186 loops=1)

4. 0.193 50.126 ↓ 186.0 186 1

Nested Loop (cost=115.05..5,981.26 rows=1 width=410) (actual time=1.474..50.126 rows=186 loops=1)

  • Join Filter: ((c.cart_id)::bpchar = (sw.cart_id)::bpchar)
5. 0.231 49.297 ↓ 212.0 212 1

Nested Loop (cost=114.77..5,980.86 rows=1 width=409) (actual time=1.459..49.297 rows=212 loops=1)

6. 2.104 48.642 ↓ 212.0 212 1

Nested Loop (cost=114.48..5,973.47 rows=1 width=408) (actual time=1.444..48.642 rows=212 loops=1)

  • Join Filter: ((max((i.vendor_id)::bpchar)) = (v.vendor_id)::bpchar)
  • Rows Removed by Join Filter: 7208
7. 0.023 0.023 ↑ 1.0 35 1

Index Scan using ix_vend_vendors_vendor_account_id on vend_vendors v (cost=0.14..12.67 rows=35 width=34) (actual time=0.009..0.023 rows=35 loops=1)

8. 0.758 46.515 ↓ 212.0 212 35

Materialize (cost=114.34..5,960.28 rows=1 width=391) (actual time=0.034..1.329 rows=212 loops=35)

9. 0.234 45.757 ↓ 212.0 212 1

Nested Loop (cost=114.34..5,960.27 rows=1 width=391) (actual time=1.195..45.757 rows=212 loops=1)

10. 0.151 43.579 ↓ 216.0 216 1

Nested Loop (cost=113.93..5,948.05 rows=1 width=351) (actual time=1.168..43.579 rows=216 loops=1)

11. 0.302 42.564 ↓ 216.0 216 1

Nested Loop (cost=113.51..5,947.43 rows=1 width=380) (actual time=1.143..42.564 rows=216 loops=1)

12. 0.207 41.398 ↓ 216.0 216 1

Nested Loop (cost=113.10..5,946.86 rows=1 width=352) (actual time=1.127..41.398 rows=216 loops=1)

13. 0.130 40.327 ↓ 216.0 216 1

Nested Loop (cost=112.68..5,946.02 rows=1 width=296) (actual time=1.114..40.327 rows=216 loops=1)

  • Join Filter: ((a.account_id)::bpchar = (c_1.account_id)::bpchar)
14. 4.027 33.285 ↓ 216.0 216 1

Nested Loop (cost=112.27..5,938.78 rows=1 width=298) (actual time=1.065..33.285 rows=216 loops=1)

  • Join Filter: (((c.account_id)::bpchar = (a.account_id)::bpchar) AND (((c.cart_name)::text ~~* '%scotch%'::text) OR ((c.cart_id)::bpchar ~~* '%scotch%'::text) OR ((a.account_id)::bpchar ~~* '%scotch%'::text) OR ((a.company_name)::text ~~* '%scotch%'::text)))
  • Rows Removed by Join Filter: 2050
15. 1.394 22.460 ↓ 2,266.0 2,266 1

Nested Loop (cost=111.98..5,938.25 rows=1 width=263) (actual time=0.901..22.460 rows=2,266 loops=1)

16. 1.107 14.094 ↓ 2,324.0 2,324 1

Nested Loop (cost=111.70..5,929.94 rows=1 width=238) (actual time=0.866..14.094 rows=2,324 loops=1)

17. 5.453 6.015 ↓ 193.7 2,324 1

Bitmap Heap Scan on sc_carts c (cost=111.42..5,838.36 rows=12 width=211) (actual time=0.850..6.015 rows=2,324 loops=1)

  • Recheck Cond: ((cart_type)::text = ANY ('{"MEDIA BUY CAMPAIGN","DIGITAL CAMPAIGN"}'::text[]))
  • Filter: (((cart_status)::text <> 'INCOMPLETE'::text) AND ((cart_id)::bpchar = COALESCE((cart_id)::bpchar)))
  • Rows Removed by Filter: 190
  • Heap Blocks: exact=1683
18. 0.562 0.562 ↓ 1.0 2,526 1

Bitmap Index Scan on ix_sc_carts_lookup_cart_type (cost=0.00..111.42 rows=2,512 width=0) (actual time=0.562..0.562 rows=2,526 loops=1)

  • Index Cond: ((cart_type)::text = ANY ('{"MEDIA BUY CAMPAIGN","DIGITAL CAMPAIGN"}'::text[]))
19. 6.972 6.972 ↑ 1.0 1 2,324

Index Scan using pk_sc_campaigns on sc_campaigns cp (cost=0.28..7.63 rows=1 width=27) (actual time=0.003..0.003 rows=1 loops=2,324)

  • Index Cond: ((cart_id)::bpchar = (c.cart_id)::bpchar)
20. 6.972 6.972 ↑ 1.0 1 2,324

Index Scan using ix_rel_masters_accounts_account_id on rel_masters_accounts m (cost=0.29..8.30 rows=1 width=42) (actual time=0.003..0.003 rows=1 loops=2,324)

  • Index Cond: ((account_id)::bpchar = (c.account_id)::bpchar)
  • Filter: ((c.master_account_id)::bpchar = (master_account_id)::bpchar)
  • Rows Removed by Filter: 1
21. 6.798 6.798 ↑ 1.0 1 2,266

Index Scan using ix_acct_accounts_account_id on acct_accounts a (cost=0.29..0.50 rows=1 width=35) (actual time=0.002..0.003 rows=1 loops=2,266)

  • Index Cond: ((account_id)::bpchar = (m.account_id)::bpchar)
22. 6.912 6.912 ↑ 1.0 1 216

Index Scan using ix_acct_contacts_account_id on acct_contacts c_1 (cost=0.41..7.23 rows=1 width=49) (actual time=0.014..0.032 rows=1 loops=216)

  • Index Cond: ((account_id)::bpchar = (m.account_id)::bpchar)
  • Filter: ((is_active IS TRUE) AND ((contact_type)::text = 'Primary'::text))
  • Rows Removed by Filter: 32
23. 0.864 0.864 ↑ 1.0 1 216

Index Scan using ix_acct_addresses_contact_id on acct_addresses ad (cost=0.41..0.84 rows=1 width=56) (actual time=0.004..0.004 rows=1 loops=216)

  • Index Cond: ((contact_id)::bpchar = (c_1.contact_id)::bpchar)
  • Filter: ((is_active IS TRUE) AND ((address_type)::text = 'Primary'::text))
24. 0.864 0.864 ↑ 1.0 1 216

Index Scan using pk_acct_phones on acct_phones p (cost=0.41..0.57 rows=1 width=28) (actual time=0.004..0.004 rows=1 loops=216)

  • Index Cond: (((contact_id)::bpchar = (ad.contact_id)::bpchar) AND ((phone_type)::text = 'Primary'::text))
  • Filter: (is_active IS TRUE)
25. 0.864 0.864 ↑ 1.0 1 216

Index Scan using ix_acct_e_info_contact_id on acct_e_info ei (cost=0.41..0.62 rows=1 width=39) (actual time=0.004..0.004 rows=1 loops=216)

  • Index Cond: ((contact_id)::bpchar = (ad.contact_id)::bpchar)
  • Filter: ((is_active IS TRUE) AND ((e_info_type)::text = 'Primary'::text))
26. 0.432 1.944 ↑ 1.0 1 216

GroupAggregate (cost=0.41..12.20 rows=1 width=57) (actual time=0.009..0.009 rows=1 loops=216)

  • Group Key: i.cart_id
27. 1.512 1.512 ↓ 2.0 2 216

Index Scan using ix_sc_items_cart_id on sc_items i (cost=0.41..12.19 rows=1 width=42) (actual time=0.006..0.007 rows=2 loops=216)

  • Index Cond: ((cart_id)::bpchar = (cp.cart_id)::bpchar)
  • Filter: ((vendor_id)::bpchar = COALESCE((vendor_id)::bpchar))
  • Rows Removed by Filter: 0
28. 0.424 0.424 ↑ 1.0 1 212

Index Scan using ix_acct_accounts_account_id on acct_accounts a_1 (cost=0.29..7.39 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=212)

  • Index Cond: ((account_id)::bpchar = (v.vendor_account_id)::bpchar)
29. 0.636 0.636 ↑ 1.0 1 212

Index Scan using pk_sc_workflows on sc_workflows sw (cost=0.28..0.40 rows=1 width=35) (actual time=0.003..0.003 rows=1 loops=212)

  • Index Cond: (((cart_id)::bpchar = (cp.cart_id)::bpchar) AND ((wf_type)::text = 'Campaign'::text))
30. 0.372 0.372 ↑ 1.0 1 186

Index Scan using pk_wf_type_statuses on wf_type_statuses wt (cost=0.14..0.17 rows=1 width=54) (actual time=0.002..0.002 rows=1 loops=186)

  • Index Cond: (((wf_type)::text = 'Campaign'::text) AND ((wf_status)::text = (sw.wf_status)::text))
31. 0.204 2.046 ↑ 1.0 1 186

Nested Loop Left Join (cost=1.24..25.33 rows=1 width=112) (actual time=0.010..0.011 rows=1 loops=186)

32. 0.204 1.302 ↑ 1.0 1 186

Nested Loop Left Join (cost=0.83..16.88 rows=1 width=26) (actual time=0.007..0.007 rows=1 loops=186)

33. 0.558 0.558 ↑ 1.0 1 186

Index Scan using ix_acct_contacts_contact_id on acct_contacts c_2 (cost=0.41..8.43 rows=1 width=15) (actual time=0.003..0.003 rows=1 loops=186)

  • Index Cond: ((contact_id)::bpchar = (c.coordination_contact_id)::bpchar)
  • Filter: ((is_active IS TRUE) AND ((contact_type)::text = 'Coordination'::text))
34. 0.540 0.540 ↑ 1.0 1 180

Index Scan using pk_acct_phones on acct_phones p_1 (cost=0.41..8.43 rows=1 width=11) (actual time=0.003..0.003 rows=1 loops=180)

  • Index Cond: (((contact_id)::bpchar = (c.coordination_contact_id)::bpchar) AND ((phone_type)::text = 'Primary'::text))
  • Filter: (is_active IS TRUE)
35. 0.540 0.540 ↑ 1.0 1 180

Index Scan using ix_acct_e_info_contact_id on acct_e_info ei_1 (cost=0.41..8.43 rows=1 width=22) (actual time=0.003..0.003 rows=1 loops=180)

  • Index Cond: ((contact_id)::bpchar = (c.coordination_contact_id)::bpchar)
  • Filter: ((is_active IS TRUE) AND ((e_info_type)::text = 'Primary'::text))
Planning time : 26.287 ms
Execution time : 53.561 ms