explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jaDf

Settings
# exclusive inclusive rows x rows loops node
1. 0.429 59,563.235 ↑ 1.0 50 1

Nested Loop Left Join (cost=1.27..8,047.19 rows=50 width=1,488) (actual time=59,430.379..59,563.235 rows=50 loops=1)

2. 0.543 59,447.106 ↑ 1.0 50 1

Nested Loop (cost=0.85..6,180.93 rows=50 width=1,237) (actual time=59,367.490..59,447.106 rows=50 loops=1)

3. 0.064 59,430.313 ↑ 1.0 50 1

Limit (cost=0.42..5,757.81 rows=50 width=12) (actual time=59,351.071..59,430.313 rows=50 loops=1)

4. 59,430.249 59,430.249 ↑ 275.0 50 1

Index Scan Backward using send_mail_email_created_at on send_mail_email (cost=0.42..1,583,165.08 rows=13,749 width=12) (actual time=59,351.067..59,430.249 rows=50 loops=1)

  • Filter: ((app_id = ANY ('{1}'::integer[])) AND (status = ANY ('{4,5}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-16'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-16'::date))
  • Rows Removed by Filter: 334700
5. 16.250 16.250 ↑ 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.325..0.325 rows=1 loops=50)

  • Index Cond: (id = send_mail_email.id)
6. 76.250 76.250 ↑ 1.0 1 50

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

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

SubPlan (forNested Loop Left Join)

8. 0.150 5.450 ↑ 1.0 1 50

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

9.          

Initplan (forResult)

10. 5.300 5.300 ↓ 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.106..0.106 rows=0 loops=50)

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

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

12.          

Initplan (forResult)

13. 0.600 0.600 ↓ 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.012..0.012 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
14. 33.250 33.250 ↑ 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.665..0.665 rows=1 loops=50)

  • Index Cond: (id = info.campaign_id)
15. 0.050 0.050 ↓ 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.001..0.001 rows=0 loops=50)

  • Index Cond: (id = info.template_id)