explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QTgk

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.093 34,218.280 ↑ 7.3 51 1

Nested Loop Left Join (cost=864,748.49..867,864.72 rows=372 width=2,789) (actual time=34,179.039..34,218.280 rows=51 loops=1)

2. 0.203 34,217.983 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.99..866,917.35 rows=51 width=2,706) (actual time=34,179.022..34,217.983 rows=51 loops=1)

  • Join Filter: ("systemAlert".id = "systemAlert->updates".system_alert_id)
  • Rows Removed by Join Filter: 204
3. 1.682 34,217.678 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.99..866,905.29 rows=51 width=2,158) (actual time=34,178.934..34,217.678 rows=51 loops=1)

  • Join Filter: ("systemAlert".administrator_id = "systemAlert->administrator".id)
  • Rows Removed by Join Filter: 12903
4. 0.114 34,214.262 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.99..866,682.58 rows=51 width=1,980) (actual time=34,178.203..34,214.262 rows=51 loops=1)

  • Join Filter: ("GlobalEventLog".system_alert_id = "systemAlert".id)
  • Rows Removed by Join Filter: 51
5. 0.118 34,214.097 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.86..866,673.66 rows=51 width=888) (actual time=34,178.170..34,214.097 rows=51 loops=1)

6. 0.087 34,183.736 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.44..866,246.71 rows=51 width=870) (actual time=34,176.995..34,183.736 rows=51 loops=1)

7. 0.081 34,178.192 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,743.00..865,815.12 rows=51 width=833) (actual time=34,176.959..34,178.192 rows=51 loops=1)

8. 0.099 34,177.805 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,742.71..865,447.06 rows=51 width=794) (actual time=34,176.940..34,177.805 rows=51 loops=1)

9. 0.087 34,177.502 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,742.44..865,239.50 rows=51 width=758) (actual time=34,176.921..34,177.502 rows=51 loops=1)

10. 0.177 34,177.415 ↑ 1.0 51 1

Nested Loop Left Join (cost=864,742.29..865,118.71 rows=51 width=719) (actual time=34,176.915..34,177.415 rows=51 loops=1)

11. 0.023 34,176.932 ↑ 1.0 51 1

Limit (cost=864,742.00..864,742.13 rows=51 width=707) (actual time=34,176.860..34,176.932 rows=51 loops=1)

12. 78.596 34,176.909 ↑ 255.1 51 1

Sort (cost=864,742.00..864,774.52 rows=13,008 width=707) (actual time=34,176.856..34,176.909 rows=51 loops=1)

  • Sort Key: "GlobalEventLog".created_at DESC, "GlobalEventLog".id
  • Sort Method: top-N heapsort Memory: 64kB
13. 34,098.313 34,098.313 ↓ 1.3 17,520 1

Seq Scan on global_event_log "GlobalEventLog" (cost=0.00..864,308.03 rows=13,008 width=707) (actual time=18.547..34,098.313 rows=17,520 loops=1)

  • Filter: ((deleted_at IS NULL) AND ((event_type)::text <> 'dock_created'::text) AND (dock_group_id = 425))
  • Rows Removed by Filter: 11231710
14. 0.306 0.306 ↑ 1.0 1 51

Index Scan using dock_pkey on dock (cost=0.29..7.36 rows=1 width=12) (actual time=0.006..0.006 rows=1 loops=51)

  • Index Cond: ("GlobalEventLog".dock_id = id)
  • Filter: (deleted_at IS NULL)
15. 0.000 0.000 ↓ 0.0 0 51

Index Scan using administrator_pkey on administrator (cost=0.14..2.36 rows=1 width=39) (actual time=0.000..0.000 rows=0 loops=51)

  • Index Cond: ("GlobalEventLog".administrator_id = id)
  • Filter: (deleted_at IS NULL)
16. 0.204 0.204 ↑ 1.0 1 51

Index Scan using dock_group_pkey on dock_group "dockGroup" (cost=0.28..4.06 rows=1 width=36) (actual time=0.004..0.004 rows=1 loops=51)

  • Index Cond: ("GlobalEventLog".dock_group_id = id)
  • Filter: (deleted_at IS NULL)
17. 0.306 0.306 ↑ 1.0 1 51

Index Scan using vehicle_pkey on vehicle (cost=0.29..7.21 rows=1 width=39) (actual time=0.005..0.006 rows=1 loops=51)

  • Index Cond: ("GlobalEventLog".vehicle_id = id)
  • Filter: (deleted_at IS NULL)
18. 5.457 5.457 ↑ 1.0 1 51

Index Scan using trip_pkey on trip (cost=0.43..8.45 rows=1 width=37) (actual time=0.106..0.107 rows=1 loops=51)

  • Index Cond: ("GlobalEventLog".trip_id = id)
  • Filter: (deleted_at IS NULL)
19. 30.243 30.243 ↑ 1.0 1 51

Index Scan using subscriber_pkey on "user" (cost=0.42..8.36 rows=1 width=18) (actual time=0.593..0.593 rows=1 loops=51)

  • Index Cond: ("GlobalEventLog".user_id = id)
  • Filter: (deleted_at IS NULL)
20. 0.041 0.051 ↑ 1.0 1 51

Materialize (cost=0.14..8.15 rows=1 width=1,092) (actual time=0.001..0.001 rows=1 loops=51)

21. 0.010 0.010 ↑ 1.0 1 1

Index Scan using "System ID and incident start time decreasing" on system_alert "systemAlert" (cost=0.14..8.15 rows=1 width=1,092) (actual time=0.009..0.010 rows=1 loops=1)

22. 1.492 1.734 ↑ 1.0 253 51

Materialize (cost=0.00..29.80 rows=253 width=178) (actual time=0.002..0.034 rows=253 loops=51)

23. 0.242 0.242 ↑ 1.0 253 1

Seq Scan on administrator "systemAlert->administrator" (cost=0.00..28.53 rows=253 width=178) (actual time=0.015..0.242 rows=253 loops=1)

  • Filter: (deleted_at IS NULL)
24. 0.073 0.102 ↓ 4.0 4 51

Materialize (cost=0.00..11.31 rows=1 width=548) (actual time=0.001..0.002 rows=4 loops=51)

25. 0.029 0.029 ↓ 4.0 4 1

Seq Scan on system_alert_update "systemAlert->updates" (cost=0.00..11.30 rows=1 width=548) (actual time=0.028..0.029 rows=4 loops=1)

  • Filter: (deleted_at IS NULL)
26. 0.102 0.204 ↓ 0.0 0 51

Nested Loop (cost=4.49..18.51 rows=7 width=63) (actual time=0.004..0.004 rows=0 loops=51)

27. 0.102 0.102 ↓ 0.0 0 51

Bitmap Heap Scan on system_alert_dock_group "systemAlert->dockGroups->SystemAlertDockGroup" (cost=4.21..14.37 rows=8 width=20) (actual time=0.002..0.002 rows=0 loops=51)

  • Recheck Cond: ("systemAlert".id = system_alert_id)
28. 0.000 0.000 ↓ 0.0 0 51

Bitmap Index Scan on system_alert_dock_group_system_alert_id_dock_group_id_pk (cost=0.00..4.21 rows=8 width=0) (actual time=0.000..0.000 rows=0 loops=51)

  • Index Cond: ("systemAlert".id = system_alert_id)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using dock_group_pkey on dock_group "systemAlert->dockGroups" (cost=0.28..0.51 rows=1 width=43) (never executed)

  • Index Cond: (id = "systemAlert->dockGroups->SystemAlertDockGroup".dock_group_id)
  • Filter: (deleted_at IS NULL)
Planning time : 4.483 ms
Execution time : 34,220.832 ms