explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Uewm

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 114.462 ↓ 3.0 3 1

GroupAggregate (cost=28,812.98..28,813.00 rows=1 width=17) (actual time=114.453..114.462 rows=3 loops=1)

  • Group Key: equipment_types.name
2. 0.036 114.435 ↓ 27.0 27 1

Sort (cost=28,812.98..28,812.98 rows=1 width=13) (actual time=114.433..114.435 rows=27 loops=1)

  • Sort Key: equipment_types.name
  • Sort Method: quicksort Memory: 26kB
3. 0.021 114.399 ↓ 27.0 27 1

Nested Loop (cost=232.45..28,812.97 rows=1 width=13) (actual time=93.506..114.399 rows=27 loops=1)

4. 0.041 114.297 ↓ 27.0 27 1

Nested Loop Left Join (cost=232.16..28,810.70 rows=1 width=8) (actual time=93.498..114.297 rows=27 loops=1)

  • Filter: ((service_desk_desks.id IS NOT NULL) OR ((desks2.user_without_access_create_ticket IS TRUE) AND (service_desk_tickets.created_by_id = 12059) AND (service_desk_desks.id IS NULL)))
5. 0.071 114.013 ↓ 27.0 27 1

Nested Loop (cost=231.59..28,799.94 rows=1 width=17) (actual time=93.483..114.013 rows=27 loops=1)

6. 3.334 113.834 ↓ 27.0 27 1

Hash Join (cost=231.31..28,799.55 rows=1 width=16) (actual time=93.463..113.834 rows=27 loops=1)

  • Hash Cond: (service_desk_tickets.equipment_id = equipment.id)
7. 107.493 107.493 ↓ 1.0 34,253 1

Index Scan using index_service_desk_tickets_on_is_closed on service_desk_tickets (cost=0.42..28,441.87 rows=33,811 width=16) (actual time=0.035..107.493 rows=34,253 loops=1)

  • Index Cond: (is_closed = false)
  • Filter: (NOT is_closed)
8. 0.081 3.007 ↓ 333.0 333 1

Hash (cost=230.87..230.87 rows=1 width=8) (actual time=3.007..3.007 rows=333 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
9. 0.142 2.926 ↓ 333.0 333 1

Nested Loop (cost=51.93..230.87 rows=1 width=8) (actual time=1.235..2.926 rows=333 loops=1)

10. 0.060 1.544 ↓ 15.5 62 1

Nested Loop (cost=51.64..227.95 rows=4 width=8) (actual time=1.223..1.544 rows=62 loops=1)

11. 0.036 1.360 ↓ 15.5 62 1

Group (cost=51.35..210.68 rows=4 width=520) (actual time=1.215..1.360 rows=62 loops=1)

  • Group Key: clients_1.id
12. 0.055 1.324 ↓ 15.5 62 1

Nested Loop Left Join (cost=51.35..210.67 rows=4 width=4) (actual time=1.213..1.324 rows=62 loops=1)

  • Join Filter: (users_clients.client_id = clients_1.id)
  • Filter: ((users_clients.id IS NOT NULL) OR (client_technical_groups.id IS NOT NULL))
13. 0.051 0.339 ↓ 15.5 62 1

Merge Left Join (cost=51.35..51.45 rows=4 width=8) (actual time=0.269..0.339 rows=62 loops=1)

  • Merge Cond: (clients_1.id = client_technical_groups.client_id)
14. 0.030 0.094 ↓ 15.5 62 1

Sort (cost=15.65..15.66 rows=4 width=4) (actual time=0.084..0.094 rows=62 loops=1)

  • Sort Key: clients_1.id
  • Sort Method: quicksort Memory: 27kB
15. 0.064 0.064 ↓ 15.5 62 1

Index Scan using organization_id_on_clients on clients clients_1 (cost=0.29..15.61 rows=4 width=4) (actual time=0.016..0.064 rows=62 loops=1)

  • Index Cond: (organization_id = 3747)
16. 0.031 0.194 ↓ 4.3 64 1

Sort (cost=35.69..35.73 rows=15 width=8) (actual time=0.181..0.194 rows=64 loops=1)

  • Sort Key: client_technical_groups.client_id
  • Sort Method: quicksort Memory: 28kB
17. 0.163 0.163 ↓ 4.3 64 1

Index Scan using index_client_technical_groups_on_technical_group_id on client_technical_groups (cost=0.42..35.40 rows=15 width=8) (actual time=0.021..0.163 rows=64 loops=1)

  • Index Cond: (technical_group_id = 9762)
18. 0.000 0.930 ↓ 0.0 0 62

Materialize (cost=0.00..159.16 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=62)

19. 0.942 0.942 ↓ 0.0 0 1

Seq Scan on users_clients (cost=0.00..159.15 rows=1 width=8) (actual time=0.942..0.942 rows=0 loops=1)

  • Filter: (user_id = 12059)
  • Rows Removed by Filter: 7612
20. 0.124 0.124 ↑ 1.0 1 62

Index Only Scan using clients_pkey on clients (cost=0.29..4.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=62)

  • Index Cond: (id = clients_1.id)
  • Heap Fetches: 0
21. 1.240 1.240 ↓ 5.0 5 62

Index Scan using index_equipment_on_client_id on equipment (cost=0.29..0.72 rows=1 width=12) (actual time=0.004..0.020 rows=5 loops=62)

  • Index Cond: (client_id = clients.id)
  • Filter: (organization_id = 3747)
22. 0.108 0.108 ↑ 1.0 1 27

Index Scan using service_desk_desks_pkey on service_desk_desks desks2 (cost=0.29..0.38 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=27)

  • Index Cond: (id = service_desk_tickets.desk_id)
23. 0.054 0.243 ↑ 1.0 1 27

Nested Loop (cost=0.57..10.75 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=27)

24. 0.054 0.054 ↑ 1.0 1 27

Index Scan using service_desk_desks_pkey on service_desk_desks (cost=0.29..0.39 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=27)

  • Index Cond: (id = service_desk_tickets.desk_id)
  • Filter: (organization_id = 3747)
25. 0.135 0.135 ↑ 1.0 1 27

Index Scan using index_desk_technical_groups_on_desk_id on desk_technical_groups (cost=0.29..10.35 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=27)

  • Index Cond: (desk_id = service_desk_desks.id)
  • Filter: (technical_group_id = 9762)
  • Rows Removed by Filter: 3
26. 0.081 0.081 ↑ 1.0 1 27

Index Scan using equipment_types_pkey on equipment_types (cost=0.29..2.27 rows=1 width=13) (actual time=0.003..0.003 rows=1 loops=27)

  • Index Cond: (id = equipment.equipment_type_id)
Planning time : 3.069 ms