explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lkfZ

Settings
# exclusive inclusive rows x rows loops node
1. 3,141.307 3,592.545 ↑ 6.6 22,732 1

Bitmap Heap Scan on public.send_mail_email mail (cost=22,442.62..4,637,242.25 rows=149,072 width=1,241) (actual time=157.100..3,592.545 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=6580
  • Buffers: shared hit=115479 read=7992
2. 132.990 132.990 ↑ 6.6 22,732 1

Bitmap Index Scan on send_mail_email_app_id_created_at_asdate_status (cost=0.00..22,405.35 rows=149,072 width=0) (actual time=132.990..132.990 rows=22,732 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=1617 read=1617
3.          

SubPlan (forBitmap Heap Scan)

4. 45.464 90.928 ↑ 1.0 1 22,732

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

  • Output: $1
  • Buffers: shared hit=22731 read=1
5.          

Initplan (forResult)

6. 45.464 45.464 ↓ 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.002..0.002 rows=0 loops=22,732)

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

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

  • Output: $3
  • Buffers: shared hit=22731 read=1
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=22731 read=1
10. 136.392 136.392 ↑ 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.005..0.006 rows=1 loops=22,732)

  • Output: campaign_campaign.status
  • Index Cond: (campaign_campaign.id = mail.campaign_id)
  • Buffers: shared hit=68176 read=11
11. 22.732 22.732 ↓ 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.001..0.001 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=3 read=3