explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t1BU

Settings
# exclusive inclusive rows x rows loops node
1. 2,525.714 2,816.678 ↑ 7.2 22,732 1

Bitmap Heap Scan on public.send_mail_email mail (cost=45,387.90..5,107,990.29 rows=163,997 width=1,241) (actual time=146.190..2,816.678 rows=22,732 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 (...)
  • Recheck Cond: ((mail.app_id = 1) AND (date(timezone('UTC'::text, mail.created_at)) >= '2018-02-12'::date) AND (date(timezone('UTC'::text, mail.created_at)) <= '2019-03-11'::date) AND (mail.status = ANY ('{4,5}'::integer[])))
  • Heap Blocks: exact=52398
  • Buffers: shared hit=127116 read=48809 written=2046
2. 131.840 131.840 ↓ 1.6 268,909 1

Bitmap Index Scan on send_mail_email_app_id_created_at_asdate_from_system_status (cost=0.00..45,346.91 rows=163,997 width=0) (actual time=131.840..131.840 rows=268,909 loops=1)

  • Index Cond: ((mail.app_id = 1) AND (date(timezone('UTC'::text, mail.created_at)) >= '2018-02-12'::date) AND (date(timezone('UTC'::text, mail.created_at)) <= '2019-03-11'::date) AND (mail.status = ANY ('{4,5}'::integer[])))
  • Buffers: shared hit=9870
3.          

SubPlan (forBitmap Heap Scan)

4. 45.464 68.196 ↑ 1.0 1 22,732

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

  • Output: $1
  • Buffers: shared hit=22732
5.          

Initplan (forResult)

6. 22.732 22.732 ↓ 0.0 0 22,732

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=22,732)

  • Index Cond: (track_linkemail.email_id = mail.id)
  • Heap Fetches: 0
  • Buffers: shared hit=22732
7. 22.732 45.464 ↑ 1.0 1 22,732

Result (cost=8.17..8.18 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=22,732)

  • Output: $3
  • Buffers: shared hit=22732
8.          

Initplan (forResult)

9. 22.732 22.732 ↓ 0.0 0 22,732

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=22,732)

  • Index Cond: (track_mailopen.email_id = mail.id)
  • Heap Fetches: 0
  • Buffers: shared hit=22732
10. 45.464 45.464 ↑ 1.0 1 22,732

Index Scan using campaign_campaign_pkey on public.campaign_campaign (cost=0.28..8.29 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=22,732)

  • Output: campaign_campaign.status
  • Index Cond: (campaign_campaign.id = mail.campaign_id)
  • Buffers: shared hit=68180 read=7
11. 0.000 0.000 ↓ 0.0 0 22,732

Index Scan using mail_template_template_pkey on public.mail_template_template (cost=0.27..8.29 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=22,732)

  • 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=6
Planning time : 0.456 ms
Execution time : 2,827.331 ms