explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OEIM

Settings
# exclusive inclusive rows x rows loops node
1. 0.367 1,462.639 ↑ 1.0 50 1

Nested Loop Left Join (cost=342.71..2,631.37 rows=50 width=1,488) (actual time=1,438.739..1,462.639 rows=50 loops=1)

2. 0.084 1,408.272 ↑ 1.0 50 1

Nested Loop (cost=342.29..765.12 rows=50 width=1,237) (actual time=1,407.685..1,408.272 rows=50 loops=1)

3. 0.067 1,397.688 ↑ 1.0 50 1

Limit (cost=341.87..341.99 rows=50 width=12) (actual time=1,397.602..1,397.688 rows=50 loops=1)

4. 12.872 1,397.621 ↑ 1.7 50 1

Sort (cost=341.87..342.08 rows=84 width=12) (actual time=1,397.598..1,397.621 rows=50 loops=1)

  • Sort Key: send_mail_email.created_at DESC
  • Sort Method: top-N heapsort Memory: 27kB
5. 1,384.749 1,384.749 ↓ 256.8 21,574 1

Index Scan using send_mail_email_app_id_status_created_at_asdate on send_mail_email (cost=0.42..339.18 rows=84 width=12) (actual time=0.856..1,384.749 rows=21,574 loops=1)

  • Index Cond: ((app_id = ANY ('{1}'::integer[])) AND (status = ANY ('{3}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-16'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-16'::date))
6. 10.500 10.500 ↑ 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.209..0.210 rows=1 loops=50)

  • Index Cond: (id = send_mail_email.id)
7. 28.500 28.500 ↑ 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=0.570..0.570 rows=1 loops=50)

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

SubPlan (forNested Loop Left Join)

9. 0.100 0.150 ↑ 1.0 1 50

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

10.          

Initplan (forResult)

11. 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: 0
12. 0.100 0.150 ↑ 1.0 1 50

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

13.          

Initplan (forResult)

14. 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
15. 25.150 25.150 ↑ 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.503..0.503 rows=1 loops=50)

  • Index Cond: (id = info.campaign_id)
16. 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)