explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IdTl

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 4,317.340 ↓ 2.0 12,949 1

Gather (cost=1,306.99..301,180.03 rows=6,523 width=201) (actual time=2.960..4,317.340 rows=12,949 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 5.479 341.389 ↓ 1.6 4,316 3 / 3

Hash Join (cost=306.99..43,988.93 rows=2,718 width=94) (actual time=2.813..341.389 rows=4,316 loops=3)

  • Hash Cond: ((ue.realm_id)::text = (r.id)::text)
3. 9.146 335.896 ↑ 1.3 4,316 3 / 3

Nested Loop (cost=305.96..43,943.38 rows=5,436 width=94) (actual time=1.301..335.896 rows=4,316 loops=3)

4. 157.805 158.413 ↑ 1.3 4,316 3 / 3

Parallel Bitmap Heap Scan on user_attribute ua (cost=305.53..22,709.30 rows=5,436 width=46) (actual time=1.061..158.413 rows=4,316 loops=3)

  • Recheck Cond: ((name)::text = 'employeeId'::text)
  • Filter: (value IS NOT NULL)
  • Heap Blocks: exact=8
5. 0.608 0.608 ↑ 1.0 12,949 1 / 3

Bitmap Index Scan on name_idx (cost=0.00..302.27 rows=13,046 width=0) (actual time=1.824..1.824 rows=12,949 loops=1)

  • Index Cond: ((name)::text = 'employeeId'::text)
6. 168.337 168.337 ↑ 1.0 1 12,949 / 3

Index Scan using constraint_fb on user_entity ue (cost=0.42..3.91 rows=1 width=85) (actual time=0.039..0.039 rows=1 loops=12,949)

  • Index Cond: ((id)::text = (ua.user_id)::text)
7. 0.004 0.014 ↑ 1.0 1 3 / 3

Hash (cost=1.02..1.02 rows=1 width=14) (actual time=0.014..0.014 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.010 0.010 ↑ 1.0 1 3 / 3

Seq Scan on realm r (cost=0.00..1.02 rows=1 width=14) (actual time=0.010..0.010 rows=1 loops=3)

  • Filter: ((name)::text <> 'master'::text)
  • Rows Removed by Filter: 1
9.          

SubPlan (for Gather)

10. 12.949 51.796 ↓ 0.0 0 12,949

Limit (cost=8.17..8.18 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=12,949)

11. 25.898 38.847 ↓ 0.0 0 12,949

Sort (cost=8.17..8.18 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=12,949)

  • Sort Key: aee.admin_event_time DESC
  • Sort Method: quicksort Memory: 25kB
12. 12.949 12.949 ↓ 0.0 0 12,949

Index Scan using resource_type_idx on admin_event_entity aee (cost=0.14..8.16 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=12,949)

  • Index Cond: ((resource_type)::text = 'USER'::text)
  • Filter: ((representation ~~ '%"enabled":false%'::text) AND ((operation_type)::text = 'UPDATE'::text) AND ((resource_path)::text = concat('users/', ue.id)))
13. 12.949 4,182.527 ↑ 1.0 1 12,949

Aggregate (cost=30.98..30.99 rows=1 width=32) (actual time=0.323..0.323 rows=1 loops=12,949)

14. 40.604 4,169.578 ↑ 2.0 1 12,949

Nested Loop (cost=24.70..30.97 rows=2 width=11) (actual time=0.314..0.322 rows=1 loops=12,949)

15. 103.592 4,117.782 ↑ 2.0 1 12,949

Hash Join (cost=24.58..30.42 rows=2 width=18) (actual time=0.311..0.318 rows=1 loops=12,949)

  • Hash Cond: ((kr.id)::text = (urm.role_id)::text)
16. 246.031 246.031 ↑ 1.1 48 12,949

Seq Scan on keycloak_role kr (cost=0.00..5.71 rows=51 width=55) (actual time=0.001..0.019 rows=48 loops=12,949)

  • Filter: ((NOT client_role) AND ((name)::text <> ALL ('{offline_access,uma_authorization,user}'::text[])))
  • Rows Removed by Filter: 76
17. 25.898 3,768.159 ↑ 1.0 5 12,949

Hash (cost=24.51..24.51 rows=5 width=37) (actual time=0.291..0.291 rows=5 loops=12,949)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
18. 3,742.261 3,742.261 ↑ 1.0 5 12,949

Index Scan using idx_user_role_mapping on user_role_mapping urm (cost=0.43..24.51 rows=5 width=37) (actual time=0.240..0.289 rows=5 loops=12,949)

  • Index Cond: ((user_id)::text = (ue.id)::text)
19. 11.192 11.192 ↑ 1.0 1 11,192

Index Only Scan using constraint_4a on realm r_1 (cost=0.13..0.30 rows=1 width=7) (actual time=0.001..0.001 rows=1 loops=11,192)

  • Index Cond: (id = (kr.realm_id)::text)
  • Heap Fetches: 0
Planning time : 0.901 ms
Execution time : 4,319.289 ms