explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zZTd

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 0.510 ↓ 0.0 0 1

Nested Loop (cost=0.84..2,052.08 rows=50 width=1,488) (actual time=0.510..0.510 rows=0 loops=1)

  • Join Filter: (send_mail_email.id = stats.email_id)
2. 0.079 0.387 ↑ 1.0 50 1

Nested Loop (cost=0.42..574.67 rows=50 width=1,237) (actual time=0.053..0.387 rows=50 loops=1)

3. 0.042 0.158 ↑ 1.0 50 1

Limit (cost=0.00..151.55 rows=50 width=4) (actual time=0.042..0.158 rows=50 loops=1)

4. 0.116 0.116 ↑ 2,887.0 50 1

Seq Scan on send_mail_email (cost=0.00..437,515.71 rows=144,348 width=4) (actual time=0.041..0.116 rows=50 loops=1)

  • Filter: ((send_date IS NULL) AND (sent_at IS NULL) AND (status = ANY ('{1}'::integer[])) AND (app_id = 1) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-12'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-15':: (...)
  • Rows Removed by Filter: 59
5. 0.150 0.150 ↑ 1.0 1 50

Index Scan using send_mail_email_pkey on send_mail_email info (cost=0.42..8.44 rows=1 width=1,233) (actual time=0.002..0.003 rows=1 loops=50)

  • Index Cond: (id = send_mail_email.id)
6. 0.100 0.100 ↓ 0.0 0 50

Index Scan using collector_stats_fc41f286 on collector_stats stats (cost=0.42..0.58 rows=1 width=255) (actual time=0.002..0.002 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
7.          

SubPlan (forNested Loop)

8. 0.000 0.000 ↓ 0.0 0

Result (cost=4.18..4.19 rows=1 width=0) (never executed)

9.          

Initplan (forResult)

10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using track_linkemail_fdfd0ebf on track_linkemail (cost=0.15..8.22 rows=2 width=0) (never executed)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
11. 0.000 0.000 ↓ 0.0 0

Result (cost=8.17..8.18 rows=1 width=0) (never executed)

12.          

Initplan (forResult)

13. 0.000 0.000 ↓ 0.0 0

Index Only Scan using track_mailopen_fdfd0ebf on track_mailopen (cost=0.15..8.17 rows=1 width=0) (never executed)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Index Scan using campaign_campaign_pkey on campaign_campaign (cost=0.28..8.29 rows=1 width=4) (never executed)

  • Index Cond: (id = info.campaign_id)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using mail_template_template_pkey on mail_template_template (cost=0.27..8.29 rows=1 width=32) (never executed)

  • Index Cond: (id = info.template_id)