explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PEao

Settings
# exclusive inclusive rows x rows loops node
1. 0.384 204.851 ↑ 1.0 50 1

Nested Loop Left Join (cost=1.27..9,217.51 rows=50 width=1,488) (actual time=163.898..204.851 rows=50 loops=1)

2. 0.116 155.517 ↑ 1.0 50 1

Nested Loop (cost=0.85..7,351.25 rows=50 width=1,237) (actual time=137.689..155.517 rows=50 loops=1)

3. 0.048 143.351 ↑ 1.0 50 1

Limit (cost=0.42..6,928.12 rows=50 width=12) (actual time=126.076..143.351 rows=50 loops=1)

4. 143.303 143.303 ↑ 228.3 50 1

Index Scan Backward using send_mail_email_created_at on send_mail_email (cost=0.42..1,581,871.09 rows=11,417 width=12) (actual time=126.072..143.303 rows=50 loops=1)

  • Filter: ((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))
  • Rows Removed by Filter: 6011
5. 12.050 12.050 ↑ 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.240..0.241 rows=1 loops=50)

  • Index Cond: (id = send_mail_email.id)
6. 22.800 22.800 ↑ 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.456..0.456 rows=1 loops=50)

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

SubPlan (forNested Loop Left Join)

8. 0.050 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)

9.          

Initplan (forResult)

10. 0.100 0.100 ↓ 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.002..0.002 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
11. 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)

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. 25.800 25.800 ↑ 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.515..0.516 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)
Planning time : 81.107 ms
Execution time : 205.315 ms