explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VTQ8

Settings
# exclusive inclusive rows x rows loops node
1. 0.137 1,130.622 ↑ 1.0 1 1

Aggregate (cost=61,835.11..61,835.12 rows=1 width=40) (actual time=1,130.622..1,130.622 rows=1 loops=1)

2. 0.001 1,130.485 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,915.24..61,763.66 rows=5,716 width=28) (actual time=1,130.485..1,130.485 rows=0 loops=1)

  • Join Filter: ((ahoy_messages.sent_at > '2019-07-09 00:00:00'::timestamp without time zone) AND (ahoy_messages.sent_at < '2019-07-09 23:59:59'::timestamp without time zone))
3. 0.001 1,130.484 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,914.82..51,854.09 rows=5,716 width=32) (actual time=1,130.484..1,130.484 rows=0 loops=1)

  • Join Filter: ((ahoy_messages.sent_at > '2019-07-09 00:00:00'::timestamp without time zone) AND (ahoy_messages.sent_at < '2019-07-09 23:59:59'::timestamp without time zone))
4. 0.034 1,130.483 ↓ 0.0 0 1

Nested Loop (cost=3,914.39..27,096.18 rows=5,716 width=20) (actual time=1,130.483..1,130.483 rows=0 loops=1)

5. 0.049 1,024.315 ↑ 45.9 19 1

HashAggregate (cost=3,913.83..3,922.55 rows=872 width=4) (actual time=1,024.295..1,024.315 rows=19 loops=1)

  • Group Key: mail_filters.id
6. 0.077 1,024.266 ↑ 45.9 19 1

Nested Loop (cost=0.41..3,911.65 rows=872 width=4) (actual time=28.597..1,024.266 rows=19 loops=1)

7. 897.131 897.131 ↑ 1.0 34 1

Seq Scan on projects (cost=0.00..3,177.31 rows=34 width=4) (actual time=0.056..897.131 rows=34 loops=1)

  • Filter: (ip_pool_name IS NULL)
  • Rows Removed by Filter: 12,500
8. 127.058 127.058 ↑ 26.0 1 34

Index Only Scan using composite_index_for_unsubscribed_percentage on mail_filters (cost=0.41..21.34 rows=26 width=8) (actual time=3.721..3.737 rows=1 loops=34)

  • Index Cond: (project_id = projects.id)
  • Heap Fetches: 3
9. 106.134 106.134 ↓ 0.0 0 19

Index Scan using index_ahoy_messages_on_mail_filter_id_and_sent_at on ahoy_messages (cost=0.56..26.51 rows=7 width=20) (actual time=5.586..5.586 rows=0 loops=19)

  • Index Cond: ((mail_filter_id = mail_filters.id) AND (sent_at > '2019-07-09 00:00:00'::timestamp without time zone) AND (sent_at < '2019-07-09 23:59:59'::timestamp without time zone))
10. 0.000 0.000 ↓ 0.0 0

Index Scan using index_person_email_opens_on_person_id on person_email_opens (cost=0.43..4.32 rows=1 width=12) (never executed)

  • Index Cond: (person_id = ahoy_messages.user_id)
  • Filter: ((created_at > '2019-07-09 00:00:00'::timestamp without time zone) AND (created_at < '2019-07-10 23:59:59'::timestamp without time zone) AND (mail_filter_id = ahoy_messages.mail_filter_id))
11. 0.000 0.000 ↓ 0.0 0

Index Scan using index_clicked_links_on_person_id on clicked_links (cost=0.42..1.72 rows=1 width=12) (never executed)

  • Index Cond: (person_id = ahoy_messages.user_id)
  • Filter: ((created_at > '2019-07-09 00:00:00'::timestamp without time zone) AND (created_at < '2019-07-10 23:59:59'::timestamp without time zone) AND (mail_filter_id = ahoy_messages.mail_filter_id))
Planning time : 127.670 ms
Execution time : 1,130.851 ms