explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GWKN

Settings
# exclusive inclusive rows x rows loops node
1. 152.755 335.928 ↑ 6.6 22,732 1

Bitmap Heap Scan on send_mail_email mail (cost=22,442.62..4,637,242.25 rows=149,072 width=1,241) (actual time=48.218..335.928 rows=22,732 loops=1)

  • Recheck Cond: ((app_id = 1) AND (date(timezone('UTC'::text, created_at)) >= '2018-02-12'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-11'::date) AND (status = ANY ('{4,5}'::integer[])))
  • Heap Blocks: exact=6580
2. 46.781 46.781 ↑ 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=46.781..46.781 rows=22,732 loops=1)

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

SubPlan (forBitmap Heap Scan)

4. 22.732 45.464 ↑ 1.0 1 22,732

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

5.          

Initplan (forResult)

6. 22.732 22.732 ↓ 0.0 0 22,732

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

  • Index Cond: (email_id = mail.id)
  • Heap Fetches: 0
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)

8.          

Initplan (forResult)

9. 22.732 22.732 ↓ 0.0 0 22,732

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

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

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

  • Index Cond: (id = mail.campaign_id)
11. 0.000 0.000 ↓ 0.0 0 22,732

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

  • Index Cond: (id = mail.template_id)