explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mFjid

Settings
# exclusive inclusive rows x rows loops node
1. 0.141 9.526 ↑ 1.0 1 1

Aggregate (cost=1,127.27..1,127.28 rows=1 width=8) (actual time=9.525..9.526 rows=1 loops=1)

2.          

Initplan (for Aggregate)

3. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..3.58 rows=1 width=0) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Index Scan using person_roles_org_part_default_organization_uuid_person_uuid_idx on person_roles_org_part_default (cost=0.55..3.58 rows=1 width=0) (never executed)

  • Index Cond: ((organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid) AND (person_uuid = '981387e3-9d1a-4d83-bd44-8866e911710b'::uuid))
  • Filter: (is_company_admin AND upper_inf(valid_range))
5. 0.001 9.385 ↓ 0.0 0 1

Nested Loop Left Join (cost=217.52..1,123.57 rows=51 width=16) (actual time=9.385..9.385 rows=0 loops=1)

  • Join Filter: (tpr.person_uuid = p.person_uuid)
  • Filter: ((p.person_uuid = '981387e3-9d1a-4d83-bd44-8866e911710b'::uuid) OR $0 OR (tpr.person_uuid IS NOT NULL))
6. 0.000 9.384 ↓ 0.0 0 1

Nested Loop Anti Join (cost=209.25..554.82 rows=51 width=16) (actual time=9.384..9.384 rows=0 loops=1)

  • Join Filter: (adm.person_uuid = p.person_uuid)
7. 0.053 9.384 ↓ 0.0 0 1

Hash Right Join (cost=208.82..420.01 rows=52 width=16) (actual time=9.383..9.384 rows=0 loops=1)

  • Hash Cond: (pr.person_uuid = p.person_uuid)
8. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=2.56..213.33 rows=30 width=16) (never executed)

  • Join Filter: (pr.roles @> ((('["'::text || (role.role_uuid)::text) || '"]'::text))::jsonb)
9. 0.000 0.000 ↓ 0.0 0

Append (cost=0.43..134.17 rows=30 width=86) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Index Scan using person_roles_org_part_default_pkey on person_roles_org_part_default pr (cost=0.43..134.02 rows=30 width=86) (never executed)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: upper_inf(valid_range)
11. 0.000 0.000 ↓ 0.0 0

Materialize (cost=2.13..65.70 rows=15 width=16) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on roles role (cost=2.13..65.63 rows=15 width=16) (never executed)

  • Recheck Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: upper_inf(valid_range)
13. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on roles_organization_uuid_idx (cost=0.00..2.13 rows=45 width=0) (never executed)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
14. 0.002 9.331 ↓ 0.0 0 1

Hash (cost=205.62..205.62 rows=52 width=16) (actual time=9.330..9.331 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
15. 0.001 9.329 ↓ 0.0 0 1

Append (cost=4.45..205.62 rows=52 width=16) (actual time=9.329..9.329 rows=0 loops=1)

16. 0.007 9.328 ↓ 0.0 0 1

Bitmap Heap Scan on persons_org_part_default p (cost=4.45..205.36 rows=52 width=16) (actual time=9.328..9.328 rows=0 loops=1)

  • Recheck Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: ((is_visible IS TRUE) AND (valid_range @> '2019-09-29 01:19:31+00'::timestamp with time zone) AND (((first_name)::text ~~* '%st%'::text) OR ((last_name)::text ~~* '%st%'::text) OR ((target_name)::text ~~* '%st%'::text) OR ((web_login)::text ~~ '%st%'::text)))
17. 9.321 9.321 ↓ 0.0 0 1

Bitmap Index Scan on persons_org_part_default_pkey (cost=0.00..4.43 rows=134 width=0) (actual time=9.321..9.321 rows=0 loops=1)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
18. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.43..134.03 rows=1 width=16) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Append (cost=0.43..134.02 rows=1 width=16) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Index Scan using person_roles_org_part_default_pkey on person_roles_org_part_default adm (cost=0.43..134.02 rows=1 width=16) (never executed)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: (is_super_admin AND upper_inf(valid_range))
21. 0.000 0.000 ↓ 0.0 0

Materialize (cost=8.27..567.86 rows=1 width=16) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=8.27..567.86 rows=1 width=16) (never executed)

  • Join Filter: (tpr.roles @> ((('["'::text || (rr.target_role_uuid)::text) || '"]'::text))::jsonb)
23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=7.84..432.86 rows=1 width=16) (never executed)

  • Join Filter: (spr.roles @> ((('["'::text || (rr.source_role_uuid)::text) || '"]'::text))::jsonb)
24. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..3.58 rows=1 width=70) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Index Scan using person_roles_org_part_default_organization_uuid_person_uuid_idx on person_roles_org_part_default spr (cost=0.55..3.58 rows=1 width=70) (never executed)

  • Index Cond: ((organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid) AND (person_uuid = '981387e3-9d1a-4d83-bd44-8866e911710b'::uuid))
  • Filter: upper_inf(valid_range)
26. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on role_on_role rr (cost=7.29..426.48 rows=102 width=32) (never executed)

  • Recheck Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: ((can_edit_person OR can_view_person OR can_use_person) AND upper_inf(valid_range))
27. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on role_on_role_organization_uuid_idx (cost=0.00..7.26 rows=312 width=0) (never executed)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
28. 0.000 0.000 ↓ 0.0 0

Append (cost=0.43..134.17 rows=30 width=86) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Index Scan using person_roles_org_part_default_pkey on person_roles_org_part_default tpr (cost=0.43..134.02 rows=30 width=86) (never executed)

  • Index Cond: (organization_uuid = '9179fd37-1322-4957-8a99-7e2056388b4f'::uuid)
  • Filter: upper_inf(valid_range)
Planning time : 70.721 ms
Execution time : 10.212 ms