explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jT1f

Settings
# exclusive inclusive rows x rows loops node
1. 0.230 1.381 ↑ 444.4 9 1

HashAggregate (cost=636.98..796.98 rows=4,000 width=132) (actual time=1.344..1.381 rows=9 loops=1)

  • Group Key: COALESCE(cu.id, 0), COALESCE(ce.name_first, ((rsr.details ->> 'name'::text))::character varying), COALESCE(ce.name_last, ''::character varying), COALESCE(ce.email_address, ((rsr.details ->> 'email'::text))::character varying), jsonb_array_elements_text(COALESCE((rsr.details -> 'output_locale'::text), '[""en_US""]'::jsonb))
2. 0.483 1.151 ↑ 8.6 466 1

ProjectSet (cost=10.64..586.98 rows=4,000 width=132) (actual time=0.043..1.151 rows=466 loops=1)

3. 0.066 0.668 ↓ 11.7 466 1

Nested Loop Left Join (cost=10.64..525.98 rows=40 width=110) (actual time=0.034..0.668 rows=466 loops=1)

  • Join Filter: (rs.cid = cupg.cid)
4. 0.008 0.143 ↑ 1.2 9 1

Nested Loop Left Join (cost=10.35..513.92 rows=11 width=114) (actual time=0.032..0.143 rows=9 loops=1)

  • Filter: ((cu.is_disabled = 0) OR (rsr.reference_id = 0))
5. 0.003 0.045 ↑ 1.0 9 1

Nested Loop Left Join (cost=0.57..388.94 rows=9 width=87) (actual time=0.025..0.045 rows=9 loops=1)

  • Join Filter: (rsr.report_schedule_recipient_type_id = 1)
6. 0.002 0.024 ↑ 1.0 9 1

Nested Loop (cost=0.29..8.99 rows=9 width=83) (actual time=0.018..0.024 rows=9 loops=1)

7. 0.007 0.007 ↑ 1.0 1 1

Index Only Scan using pk_report_schedules on report_schedules rs (cost=0.14..4.18 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: ((cid = 1826) AND (id = 23))
  • Heap Fetches: 1
8. 0.015 0.015 ↑ 1.0 9 1

Index Scan using idx_report_schedule_recipients_report_schedule_id on report_schedule_recipients rsr (cost=0.14..4.54 rows=9 width=83) (actual time=0.011..0.015 rows=9 loops=1)

  • Index Cond: (report_schedule_id = 23)
  • Filter: ((cid = 1826) AND (report_schedule_recipient_type_id = ANY ('{1,2,5}'::integer[])))
9. 0.018 0.018 ↓ 0.0 0 9

Index Scan using idx_company_user_groups_company_group_id on company_user_groups cug (cost=0.28..29.25 rows=399 width=12) (actual time=0.002..0.002 rows=0 loops=9)

  • Index Cond: (rsr.reference_id = company_group_id)
  • Filter: ((cid = 1826) AND (rsr.cid = cid))
10. 0.013 0.090 ↑ 1.0 1 9

Nested Loop Left Join (cost=9.78..13.85 rows=1 width=51) (actual time=0.010..0.010 rows=1 loops=9)

11. 0.018 0.045 ↑ 1.0 1 9

Bitmap Heap Scan on company_users cu (cost=9.49..13.45 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=9)

  • Recheck Cond: ((rsr.reference_id = id) OR ((cid = 1826) AND (cug.company_user_id = id)))
  • Filter: ((deleted_on IS NULL) AND (cid = 1826) AND (company_user_type_id = 2) AND (rsr.cid = cid) AND (((rsr.report_schedule_recipient_type_id = 2) AND (rsr.reference_id = id)) OR (cug.company_user_id = id)))
  • Heap Blocks: exact=8
12. 0.000 0.027 ↓ 0.0 0 9

BitmapOr (cost=9.49..9.49 rows=2 width=0) (actual time=0.003..0.003 rows=0 loops=9)

13. 0.027 0.027 ↑ 1.0 1 9

Bitmap Index Scan on idx_company_users_id (cost=0.00..2.29 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=9)

  • Index Cond: (rsr.reference_id = id)
14. 0.000 0.000 ↓ 0.0 0 9

Bitmap Index Scan on pk_company_users (cost=0.00..0.31 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=9)

  • Index Cond: ((cid = 1826) AND (cug.company_user_id = id))
15. 0.032 0.032 ↑ 1.0 1 8

Index Scan using idx_company_employees_id on company_employees ce (cost=0.29..0.37 rows=1 width=47) (actual time=0.004..0.004 rows=1 loops=8)

  • Index Cond: (id = cu.company_employee_id)
  • Filter: ((cid = 1826) AND (cid = cu.cid))
16. 0.459 0.459 ↓ 5.2 52 9

Index Scan using idx_company_user_property_groups_company_user_id on company_user_property_groups cupg (cost=0.29..0.77 rows=10 width=8) (actual time=0.004..0.051 rows=52 loops=9)

  • Index Cond: (cu.id = company_user_id)
  • Filter: (cid = 1826)
Planning time : 1.185 ms