explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1rit : st

Settings
# exclusive inclusive rows x rows loops node
1. 5.895 163.986 ↑ 1.0 34,656 1

Hash Left Join (cost=36,347.26..80,153.66 rows=35,685 width=64) (actual time=104.917..163.986 rows=34,656 loops=1)

  • Hash Cond: ((cadences.team_id = replied_email_counts.team_id) AND (cadences.id = replied_email_counts.cadence_id))
2. 4.895 157.217 ↑ 1.0 34,656 1

Hash Left Join (cost=35,426.73..79,045.78 rows=35,685 width=56) (actual time=104.035..157.217 rows=34,656 loops=1)

  • Hash Cond: ((cadences.team_id = clicked_email_counts.team_id) AND (cadences.id = clicked_email_counts.cadence_id))
3. 4.674 150.710 ↑ 1.0 34,656 1

Hash Left Join (cost=34,148.93..77,580.63 rows=35,685 width=48) (actual time=102.415..150.710 rows=34,656 loops=1)

  • Hash Cond: ((cadences.team_id = viewed_email_counts.team_id) AND (cadences.id = viewed_email_counts.cadence_id))
4. 4.505 132.870 ↑ 1.0 34,656 1

Hash Left Join (cost=22,146.51..65,390.87 rows=35,685 width=40) (actual time=89.237..132.870 rows=34,656 loops=1)

  • Hash Cond: ((cadences.team_id = bounced_email_counts.team_id) AND (cadences.id = bounced_email_counts.cadence_id))
5. 4.579 121.081 ↑ 1.0 34,656 1

Hash Left Join (cost=19,828.28..62,885.29 rows=35,685 width=32) (actual time=81.949..121.081 rows=34,656 loops=1)

  • Hash Cond: ((cadences.team_id = call_counts.team_id) AND (cadences.id = call_counts.cadence_id))
6. 5.203 116.353 ↑ 1.0 34,656 1

Hash Right Join (cost=19,418.30..62,287.96 rows=35,685 width=24) (actual time=81.788..116.353 rows=34,656 loops=1)

  • Hash Cond: ((email_events.team_id = cadences.team_id) AND (email_events.cadence_id = cadences.id))
7. 83.547 83.547 ↑ 6.5 68 1

GroupAggregate (cost=0.70..42,863.61 rows=442 width=24) (actual time=54.127..83.547 rows=68 loops=1)

  • Group Key: email_events.team_id, email_events.cadence_id
  • -> Index Only Scan using index_email_events_on_team_type_cadence_published_at_source on email_events (cost=0.70..42855.88 rows=442 width=16) (actual time=52.604..83.365 r
  • Index Cond: ((team_id = 1070) AND (type = 'EmailEvent::Sent'::text) AND (cadence_id IS NOT NULL) AND (published_at > '2019-04-08 21:00:00'::timestamp without time zon
  • Heap Fetches: 623
8. 5.821 27.603 ↑ 1.0 34,656 1

Hash (cost=18,882.33..18,882.33 rows=35,685 width=16) (actual time=27.603..27.603 rows=34,656 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2137kB
9. 19.637 21.782 ↑ 1.0 34,656 1

Bitmap Heap Scan on cadences (cost=713.01..18,882.33 rows=35,685 width=16) (actual time=3.445..21.782 rows=34,656 loops=1)

  • Recheck Cond: (team_id = 1070)
  • Filter: (created_at <= '2019-04-08 21:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 8
  • Heap Blocks: exact=10927
10. 2.145 2.145 ↑ 1.0 35,163 1

Bitmap Index Scan on index_cadences_on_team_id (cost=0.00..704.08 rows=35,688 width=0) (actual time=2.145..2.145 rows=35,163 loops=1)

  • Index Cond: (team_id = 1070)
11. 0.005 0.149 ↑ 3.2 22 1

Hash (cost=408.92..408.92 rows=71 width=24) (actual time=0.149..0.149 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.003 0.144 ↑ 3.2 22 1

Subquery Scan on call_counts (cost=406.79..408.92 rows=71 width=24) (actual time=0.128..0.144 rows=22 loops=1)

13. 0.014 0.141 ↑ 3.2 22 1

GroupAggregate (cost=406.79..408.21 rows=71 width=24) (actual time=0.127..0.141 rows=22 loops=1)

  • Group Key: call_events.team_id, call_events.cadence_id
14. 0.020 0.127 ↓ 1.1 79 1

Sort (cost=406.79..406.97 rows=71 width=16) (actual time=0.123..0.127 rows=79 loops=1)

  • Sort Key: call_events.cadence_id
  • Sort Method: quicksort Memory: 28kB
15. 0.107 0.107 ↓ 1.1 79 1

Index Scan using index_call_events_on_team_id_and_hour on call_events (cost=0.56..404.61 rows=71 width=16) (actual time=0.018..0.107 rows=79 loops=1)

  • Index Cond: ((team_id = 1070) AND (date_trunc('hour'::text, created_at) = '2019-04-08 21:00:00'::timestamp without time zone))
  • Filter: (cadence_id IS NOT NULL)
  • Rows Removed by Filter: 112
16. 0.006 7.284 ↑ 3.4 7 1

Hash (cost=2,317.87..2,317.87 rows=24 width=24) (actual time=7.283..7.284 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.002 7.278 ↑ 3.4 7 1

Subquery Scan on bounced_email_counts (cost=0.70..2,317.87 rows=24 width=24) (actual time=6.263..7.278 rows=7 loops=1)

18. 7.276 7.276 ↑ 3.4 7 1

GroupAggregate (cost=0.70..2,317.63 rows=24 width=24) (actual time=6.262..7.276 rows=7 loops=1)

  • Group Key: email_events_1.team_id, email_events_1.cadence_id
  • -> Index Only Scan using index_email_events_on_team_type_cadence_published_at_source on email_events email_events_1 (cost=0.70..2317.21 rows=24 width=16) (actual time=3.8
  • Index Cond: ((team_id = 1070) AND (type = 'EmailEvent::Bounced'::text) AND (cadence_id IS NOT NULL) AND (published_at > '2019-04-08 21:00:00'::timestamp without time
  • Heap Fetches: 73
19. 0.027 13.166 ↑ 1.2 103 1

Hash (cost=12,000.56..12,000.56 rows=124 width=24) (actual time=13.166..13.166 rows=103 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
20. 0.015 13.139 ↑ 1.2 103 1

Subquery Scan on viewed_email_counts (cost=0.70..12,000.56 rows=124 width=24) (actual time=0.644..13.139 rows=103 loops=1)

21. 13.124 13.124 ↑ 1.2 103 1

GroupAggregate (cost=0.70..11,999.32 rows=124 width=24) (actual time=0.643..13.124 rows=103 loops=1)

  • Group Key: email_events_2.team_id, email_events_2.cadence_id
  • -> Index Only Scan using index_email_events_on_team_type_cadence_published_at_source on email_events email_events_2 (cost=0.70..11997.15 rows=124 width=24) (actual time=0.285..
  • Index Cond: ((team_id = 1070) AND (type = 'EmailEvent::Viewed'::text) AND (cadence_id IS NOT NULL) AND (published_at > '2019-04-08 21:00:00'::timestamp without time zone))
  • Heap Fetches: 297
22. 0.004 1.612 ↓ 1.3 17 1

Hash (cost=1,277.60..1,277.60 rows=13 width=24) (actual time=1.612..1.612 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.003 1.608 ↓ 1.3 17 1

Subquery Scan on clicked_email_counts (cost=0.70..1,277.60 rows=13 width=24) (actual time=0.491..1.608 rows=17 loops=1)

24. 1.605 1.605 ↓ 1.3 17 1

GroupAggregate (cost=0.70..1,277.47 rows=13 width=24) (actual time=0.491..1.605 rows=17 loops=1)

  • Group Key: email_events_3.team_id, email_events_3.cadence_id
  • -> Index Only Scan using index_email_events_on_team_type_cadence_published_at_source on email_events email_events_3 (cost=0.70..1277.25 rows=13 width=24) (actual time=0.246..1.571 ro
  • Index Cond: ((team_id = 1070) AND (type = 'EmailEvent::Clicked'::text) AND (cadence_id IS NOT NULL) AND (published_at > '2019-04-08 21:00:00'::timestamp without time zone))
  • Heap Fetches: 51
25. 0.004 0.874 ↓ 1.6 14 1

Hash (cost=920.40..920.40 rows=9 width=24) (actual time=0.874..0.874 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.002 0.870 ↓ 1.6 14 1

Subquery Scan on replied_email_counts (cost=0.70..920.40 rows=9 width=24) (actual time=0.172..0.870 rows=14 loops=1)

27. 0.868 0.868 ↓ 1.6 14 1

GroupAggregate (cost=0.70..920.31 rows=9 width=24) (actual time=0.171..0.868 rows=14 loops=1)

  • Group Key: email_events_4.team_id, email_events_4.cadence_id
  • -> Index Only Scan using index_email_events_on_team_type_cadence_published_at_source on email_events email_events_4 (cost=0.70..920.15 rows=9 width=24) (actual time=0.149..0.849 rows=24 lo
  • Index Cond: ((team_id = 1070) AND (type = 'EmailEvent::Replied'::text) AND (cadence_id IS NOT NULL) AND (published_at > '2019-04-08 21:00:00'::timestamp without time zone))
  • Heap Fetches: 9