explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9NVG

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

Gather (cost=1,306.99..301,181.70 rows=6,523 width=238) (actual time=2.850..4,074.970 rows=12,949 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 3.149 436.908 ↓ 1.6 4,316 3 / 3

Hash Join (cost=306.99..43,990.59 rows=2,718 width=94) (actual time=0.908..436.908 rows=4,316 loops=3)

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

Nested Loop (cost=305.96..43,945.05 rows=5,436 width=94) (actual time=0.835..433.746 rows=4,316 loops=3)

4. 114.101 114.693 ↑ 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=0.806..114.693 rows=4,316 loops=3)

  • Recheck Cond: ((name)::text = 'employeeId'::text)
  • Filter: (value IS NOT NULL)
  • Heap Blocks: exact=1
5. 0.592 0.592 ↑ 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.775..1.775 rows=12,949 loops=1)

  • Index Cond: ((name)::text = 'employeeId'::text)
6. 315.092 315.092 ↑ 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.073..0.073 rows=1 loops=12,949)

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

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

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

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

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

SubPlan (for Gather)

10. 12.949 38.847 ↓ 0.0 0 12,949

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

11. 12.949 25.898 ↓ 0.0 0 12,949

Sort (cost=8.17..8.18 rows=1 width=8) (actual time=0.002..0.002 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 3,936.496 ↑ 1.0 1 12,949

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

14. 27.655 3,923.547 ↑ 2.0 1 12,949

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

15. 90.643 3,884.700 ↑ 2.0 1 12,949

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

  • Hash Cond: ((kr.id)::text = (urm.role_id)::text)
16. 207.184 207.184 ↑ 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.016 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. 38.847 3,586.873 ↑ 1.0 5 12,949

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
18. 3,548.026 3,548.026 ↑ 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.224..0.274 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.861 ms
Execution time : 4,076.642 ms