explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rgym

Settings
# exclusive inclusive rows x rows loops node
1. 6,543.567 6,757.374 ↓ 64.8 19,437 1

Index Scan using send_mail_email_app_id_created_at_asdate_from_system_status on public.send_mail_email mail (cost=0.43..30,267.48 rows=300 width=1,241) (actual time=5.080..6,757.374 rows=19,437 loops=1)

  • Output: mail.id, mail.app_id, mail.name_sender, mail.email_sender, mail.name_receiver, mail.email, mail.subject, mail.uuid, mail.content, mail.second_content, mail.created_at, mail.scheduled_at, mail.sent_at, mail.campaign_id, mail.sended, mail.not_sende (...)
  • Index Cond: ((mail.app_id = 1) AND (date(timezone('UTC'::text, mail.created_at)) >= '2018-12-12'::date) AND (date(timezone('UTC'::text, mail.created_at)) <= '2019-03-11'::date) AND (mail.from_system = false) AND (mail.status = 3))
  • Filter: (NOT mail.from_system)
  • Buffers: shared hit=101148 read=11850 dirtied=60
2.          

SubPlan (forIndex Scan)

3. 38.874 58.311 ↑ 1.0 1 19,437

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

  • Output: $1
  • Buffers: shared hit=19437 read=1
4.          

Initplan (forResult)

5. 19.437 19.437 ↓ 0.0 0 19,437

Index Only Scan using track_linkemail_fdfd0ebf on public.track_linkemail (cost=0.15..8.22 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=19,437)

  • Index Cond: (track_linkemail.email_id = mail.id)
  • Heap Fetches: 1
  • Buffers: shared hit=19437 read=1
6. 38.874 58.311 ↑ 1.0 1 19,437

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

  • Output: $3
  • Buffers: shared hit=19437 read=1
7.          

Initplan (forResult)

8. 19.437 19.437 ↓ 0.0 0 19,437

Index Only Scan using track_mailopen_fdfd0ebf on public.track_mailopen (cost=0.15..8.17 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=19,437)

  • Index Cond: (track_mailopen.email_id = mail.id)
  • Heap Fetches: 1
  • Buffers: shared hit=19437 read=1
9. 77.748 77.748 ↑ 1.0 1 19,437

Index Scan using campaign_campaign_pkey on public.campaign_campaign (cost=0.28..8.29 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=19,437)

  • Output: campaign_campaign.status
  • Index Cond: (campaign_campaign.id = mail.campaign_id)
  • Buffers: shared hit=58132 read=8
10. 19.437 19.437 ↓ 0.0 0 19,437

Index Scan using mail_template_template_pkey on public.mail_template_template (cost=0.27..8.29 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=19,437)

  • Output: row_to_json(ROW(mail_template_template.name, mail_template_template.slug))
  • Index Cond: (mail_template_template.id = mail.template_id)
  • Buffers: shared hit=146 read=1