explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uRLh

Settings
# exclusive inclusive rows x rows loops node
1. 1.857 26,887.188 ↑ 1.0 50 1

Nested Loop (cost=417,615.18..419,485.76 rows=50 width=1,237) (actual time=26,884.137..26,887.188 rows=50 loops=1)

2. 0.504 26,817.481 ↑ 1.0 50 1

Limit (cost=417,614.75..417,614.88 rows=50 width=12) (actual time=26,817.414..26,817.481 rows=50 loops=1)

3. 264.800 26,816.977 ↑ 5,855.2 50 1

Sort (cost=417,614.75..418,346.66 rows=292,762 width=12) (actual time=26,816.949..26,816.977 rows=50 loops=1)

  • Sort Key: send_mail_email.created_at DESC
  • Sort Method: top-N heapsort Memory: 27kB
4. 26,172.397 26,552.177 ↓ 1.5 426,057 1

Bitmap Heap Scan on send_mail_email (cost=8,253.14..407,889.41 rows=292,762 width=12) (actual time=393.961..26,552.177 rows=426,057 loops=1)

  • Recheck Cond: ((app_id = ANY ('{1}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-15'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-15'::date))
  • Rows Removed by Index Recheck: 28083
  • Heap Blocks: exact=34944 lossy=52985
5. 379.780 379.780 ↓ 1.5 426,057 1

Bitmap Index Scan on send_mail_email_app_id_created_at_asdate_status (cost=0.00..8,179.95 rows=292,762 width=0) (actual time=379.780..379.780 rows=426,057 loops=1)

  • Index Cond: ((app_id = ANY ('{1}'::integer[])) AND (date(timezone('UTC'::text, created_at)) >= '2018-12-15'::date) AND (date(timezone('UTC'::text, created_at)) <= '2019-03-15'::date))
6. 45.050 45.050 ↑ 1.0 1 50

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.900..0.901 rows=1 loops=50)

  • Index Cond: (id = send_mail_email.id)
7.          

SubPlan (forNested Loop)

8. 0.100 0.500 ↑ 1.0 1 50

Result (cost=4.18..4.19 rows=1 width=0) (actual time=0.010..0.010 rows=1 loops=50)

9.          

Initplan (forResult)

10. 0.400 0.400 ↓ 0.0 0 50

Index Only Scan using track_linkemail_fdfd0ebf on track_linkemail (cost=0.15..8.22 rows=2 width=0) (actual time=0.008..0.008 rows=0 loops=50)

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
11. 0.050 0.400 ↑ 1.0 1 50

Result (cost=8.17..8.18 rows=1 width=0) (actual time=0.008..0.008 rows=1 loops=50)

12.          

Initplan (forResult)

13. 0.350 0.350 ↓ 0.0 0 50

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

  • Index Cond: (email_id = info.id)
  • Heap Fetches: 0
14. 21.900 21.900 ↑ 1.0 1 50

Index Scan using campaign_campaign_pkey on campaign_campaign (cost=0.28..8.29 rows=1 width=4) (actual time=0.437..0.438 rows=1 loops=50)

  • Index Cond: (id = info.campaign_id)
15. 0.000 0.000 ↓ 0.0 0 50

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

  • Index Cond: (id = info.template_id)