explain.depesz.com

PostgreSQL's explain analyze made readable

Result: u4y5

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 22,621.059 ↓ 0.0 0 1

Nested Loop Left Join (cost=408,543.34..408,588.37 rows=1 width=1,488) (actual time=22,621.059..22,621.059 rows=0 loops=1)

2. 0.001 22,621.057 ↓ 0.0 0 1

Nested Loop (cost=408,542.92..408,550.96 rows=1 width=1,237) (actual time=22,621.057..22,621.057 rows=0 loops=1)

3. 0.006 22,621.056 ↓ 0.0 0 1

Limit (cost=408,542.49..408,542.50 rows=1 width=12) (actual time=22,621.056..22,621.056 rows=0 loops=1)

4. 0.363 22,621.050 ↓ 0.0 0 1

Sort (cost=408,542.49..408,542.50 rows=1 width=12) (actual time=22,621.050..22,621.050 rows=0 loops=1)

  • Sort Key: send_mail_email.created_at DESC
  • Sort Method: quicksort Memory: 25kB
5. 22,469.342 22,620.687 ↓ 0.0 0 1

Bitmap Heap Scan on send_mail_email (cost=8,179.79..408,542.48 rows=1 width=12) (actual time=22,620.687..22,620.687 rows=0 loops=1)

  • Recheck Cond: ((app_id = ANY ('{1}'::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 Index Recheck: 28073
  • Filter: ((email_sender)::text ~~* '%success+++951@simulator.amazonses.com%'::text)
  • Rows Removed by Filter: 426046
  • Heap Blocks: exact=34939 lossy=52984
6. 151.345 151.345 ↓ 1.5 426,046 1

Bitmap Index Scan on send_mail_email_app_id_created_at_asdate_status (cost=0.00..8,179.79 rows=292,749 width=0) (actual time=151.345..151.345 rows=426,046 loops=1)

  • Index Cond: ((app_id = ANY ('{1}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-16'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-16'::date))
7. 0.000 0.000 ↓ 0.0 0

Index Scan using send_mail_email_pkey on send_mail_email info (cost=0.42..8.44 rows=1 width=1,233) (never executed)

  • Index Cond: (id = send_mail_email.id)
8. 0.000 0.000 ↓ 0.0 0

Index Scan using collector_stats_fc41f286 on collector_stats stats (cost=0.42..8.44 rows=1 width=255) (never executed)

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

SubPlan (forNested Loop Left Join)

10. 0.000 0.000 ↓ 0.0 0

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

11.          

Initplan (forResult)

12. 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
13. 0.000 0.000 ↓ 0.0 0

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

14.          

Initplan (forResult)

15. 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
16. 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)
17. 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)
Planning time : 30.508 ms
Execution time : 22,623.235 ms