explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dmDb

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 0.148 ↑ 2.0 2 1

Nested Loop (cost=1.54..1,218.35 rows=4 width=1,488) (actual time=0.102..0.148 rows=2 loops=1)

  • Join Filter: (send_mail_email.id = stats.email_id)
2. 0.002 0.072 ↑ 2.0 2 1

Nested Loop (cost=1.12..1,100.15 rows=4 width=1,237) (actual time=0.051..0.072 rows=2 loops=1)

3. 0.006 0.058 ↑ 2.0 2 1

Limit (cost=0.70..1,066.30 rows=4 width=4) (actual time=0.043..0.058 rows=2 loops=1)

4. 0.005 0.052 ↑ 2.0 2 1

Nested Loop (cost=0.70..1,066.30 rows=4 width=4) (actual time=0.041..0.052 rows=2 loops=1)

5. 0.020 0.020 ↑ 1.0 1 1

Index Scan using mail_template_template_slug_f4bfe8c9_uniq on mail_template_template (cost=0.27..8.29 rows=1 width=4) (actual time=0.019..0.020 rows=1 loops=1)

  • Index Cond: ((slug)::text = 'teste-01-neiblo'::text)
6. 0.027 0.027 ↑ 2.0 2 1

Index Scan using send_mail_email_74f53564 on send_mail_email (cost=0.42..1,057.97 rows=4 width=8) (actual time=0.017..0.027 rows=2 loops=1)

  • Index Cond: (template_id = mail_template_template.id)
  • Filter: ((app_id = ANY ('{1}'::integer[])) AND (status = ANY ('{3}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-12'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-14'::date))
  • Rows Removed by Filter: 4
7. 0.012 0.012 ↑ 1.0 1 2

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.005..0.006 rows=1 loops=2)

  • Index Cond: (id = send_mail_email.id)
8. 0.010 0.010 ↑ 1.0 1 2

Index Scan using collector_stats_fc41f286 on collector_stats stats (cost=0.42..0.58 rows=1 width=255) (actual time=0.005..0.005 rows=1 loops=2)

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

SubPlan (forNested Loop)

10. 0.010 0.014 ↑ 1.0 1 2

Result (cost=4.18..4.19 rows=1 width=0) (actual time=0.006..0.007 rows=1 loops=2)

11.          

Initplan (forResult)

12. 0.004 0.004 ↓ 0.0 0 2

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=2)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
13. 0.004 0.008 ↑ 1.0 1 2

Result (cost=8.17..8.18 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=2)

14.          

Initplan (forResult)

15. 0.004 0.004 ↓ 0.0 0 2

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

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
16. 0.002 0.002 ↓ 0.0 0 2

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=0 loops=2)

  • Index Cond: (id = info.campaign_id)
17. 0.022 0.022 ↑ 1.0 1 2

Index Scan using mail_template_template_pkey on mail_template_template mail_template_template_1 (cost=0.27..8.29 rows=1 width=32) (actual time=0.010..0.011 rows=1 loops=2)

  • Index Cond: (id = info.template_id)