explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q1Ps

Settings
# exclusive inclusive rows x rows loops node
1. 0.389 2.527 ↑ 1.0 1 1

Aggregate (cost=29.77..29.78 rows=1 width=40) (actual time=2.527..2.527 rows=1 loops=1)

2. 0.001 2.138 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.67..29.76 rows=1 width=28) (actual time=2.138..2.138 rows=0 loops=1)

  • Join Filter: ((ahoy_messages.sent_at > '2019-07-17 00:00:00'::timestamp without time zone) AND (ahoy_messages.sent_at < '2019-07-17 23:59:59'::timestamp without time zone) AND (person_email_opens.mail_filter_id = ahoy_messages.mail_filter_id) AND (person_email_opens.person_id = ahoy_messages.user_id))
3. 0.000 2.137 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.67..21.43 rows=1 width=32) (actual time=2.137..2.137 rows=0 loops=1)

  • Join Filter: ((ahoy_messages.sent_at > '2019-07-17 00:00:00'::timestamp without time zone) AND (ahoy_messages.sent_at < '2019-07-17 23:59:59'::timestamp without time zone) AND (clicked_links.mail_filter_id = ahoy_messages.mail_filter_id) AND (clicked_links.person_id = ahoy_messages.user_id))
4. 0.012 2.137 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.67..17.30 rows=1 width=20) (actual time=2.137..2.137 rows=0 loops=1)

5. 2.087 2.087 ↓ 19.0 19 1

Index Scan using index_ahoy_messages_on_sent_at_and_reference_id on ahoy_messages (cost=0.27..8.29 rows=1 width=20) (actual time=0.017..2.087 rows=19 loops=1)

  • Index Cond: ((sent_at > '2019-07-17 00:00:00'::timestamp without time zone) AND (sent_at < '2019-07-17 23:59:59'::timestamp without time zone))
6. 0.019 0.038 ↓ 0.0 0 19

Nested Loop (cost=0.40..9.00 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=19)

7. 0.019 0.019 ↓ 0.0 0 19

Index Scan using mail_filters_pkey on mail_filters (cost=0.27..8.29 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=19)

  • Index Cond: (id = ahoy_messages.mail_filter_id)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using projects_pkey on projects (cost=0.13..0.42 rows=1 width=4) (never executed)

  • Index Cond: (id = mail_filters.project_id)
  • Filter: (ip_pool_name IS NULL)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on clicked_links (cost=0.00..4.11 rows=1 width=12) (never executed)

  • Filter: ((created_at > '2019-07-17 00:00:00'::timestamp without time zone) AND (created_at < '2019-07-18 23:59:59'::timestamp without time zone))
10. 0.000 0.000 ↓ 0.0 0

Seq Scan on person_email_opens (cost=0.00..8.31 rows=1 width=12) (never executed)

  • Filter: ((created_at > '2019-07-17 00:00:00'::timestamp without time zone) AND (created_at < '2019-07-18 23:59:59'::timestamp without time zone))
Planning time : 55.553 ms
Execution time : 3.013 ms