explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PR8c

Settings
# exclusive inclusive rows x rows loops node
1. 0.361 1.633 ↑ 1.0 50 1

Nested Loop (cost=1.27..2,139.05 rows=50 width=1,480) (actual time=0.452..1.633 rows=50 loops=1)

  • Join Filter: (mail.id = stats.email_id)
2. 0.064 0.772 ↑ 1.0 50 1

Nested Loop (cost=0.85..660.59 rows=50 width=1,229) (actual time=0.393..0.772 rows=50 loops=1)

3. 0.050 0.508 ↑ 1.0 50 1

Limit (cost=0.42..237.47 rows=50 width=4) (actual time=0.379..0.508 rows=50 loops=1)

4. 0.458 0.458 ↑ 290.2 50 1

Index Scan using send_mail_email_app_id_created_at_asdate_status on send_mail_email mail (cost=0.42..68,790.27 rows=14,510 width=4) (actual time=0.374..0.458 rows=50 loops=1)

  • Index Cond: ((app_id = 1) AND (date(timezone('UTC'::text, created_at)) >= '2018-02-12'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-11'::date) AND (status = ANY ('{3}'::integer[])))
5. 0.200 0.200 ↑ 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,225) (actual time=0.003..0.004 rows=1 loops=50)

  • Index Cond: (id = mail.id)
6. 0.150 0.150 ↑ 1.0 1 50

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

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

SubPlan (forNested Loop)

8. 0.050 0.100 ↑ 1.0 1 50

Result (cost=4.18..4.19 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=50)

9.          

Initplan (forResult)

10. 0.050 0.050 ↓ 0.0 0 50

Index Only Scan using track_linkemail_fdfd0ebf on track_linkemail (cost=0.15..8.22 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 1
11. 0.050 0.100 ↑ 1.0 1 50

Result (cost=8.17..8.18 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=50)

12.          

Initplan (forResult)

13. 0.050 0.050 ↓ 0.0 0 50

Index Only Scan using track_mailopen_fdfd0ebf on track_mailopen (cost=0.15..8.17 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
14. 0.050 0.050 ↑ 1.0 1 50

Index Scan using campaign_campaign_pkey on campaign_campaign (cost=0.28..8.29 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=50)

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

Index Scan using mail_template_template_pkey on mail_template_template (cost=0.27..8.29 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=50)

  • Index Cond: (id = info.template_id)