explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MDwC

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 51.402 ↑ 1.0 1 1

Limit (cost=9.45..31.91 rows=1 width=546) (actual time=51.402..51.402 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.001 0.024 ↑ 1.0 1 1

Limit (cost=0.00..5.50 rows=1 width=8) (actual time=0.024..0.024 rows=1 loops=1)

4. 0.023 0.023 ↑ 1.0 1 1

Seq Scan on cad_commands (cost=0.00..5.50 rows=1 width=8) (actual time=0.023..0.023 rows=1 loops=1)

  • Filter: (active AND ((tag)::text = 'log'::text))
  • Rows Removed by Filter: 5
5. 0.000 0.000 ↓ 0.0 0

Seq Scan on cad_incidents_status_types (cost=0.00..1.05 rows=1 width=8) (never executed)

  • Filter: ((abbreviation)::text = 'C'::text)
6. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on cad_incidents_status_types cad_incidents_status_types_1 (cost=0.00..1.05 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=1)

  • Filter: ((abbreviation)::text = 'A'::text)
  • Rows Removed by Filter: 3
7. 0.049 51.400 ↑ 847,653.0 1 1

Nested Loop Left Join (cost=1.85..19,036,436.98 rows=847,653 width=546) (actual time=51.400..51.400 rows=1 loops=1)

  • Join Filter: (ua.unitaction = ul.unitaction)
  • Rows Removed by Join Filter: 3
8. 0.009 51.335 ↑ 150,027.0 1 1

Nested Loop Left Join (cost=1.85..16,385,379.45 rows=150,027 width=518) (actual time=51.335..51.335 rows=1 loops=1)

9. 0.017 51.290 ↑ 150,027.0 1 1

Nested Loop Left Join (cost=1.71..16,358,844.93 rows=150,027 width=518) (actual time=51.290..51.290 rows=1 loops=1)

  • Join Filter: ((cu.description)::text = u.unitnumber)
  • Rows Removed by Join Filter: 213
10. 0.003 51.118 ↑ 150,027.0 1 1

Nested Loop Left Join (cost=1.71..13,408,494.62 rows=150,027 width=490) (actual time=51.118..51.118 rows=1 loops=1)

11. 0.005 51.096 ↑ 150,027.0 1 1

Nested Loop (cost=1.43..13,362,732.27 rows=150,027 width=294) (actual time=51.096..51.096 rows=1 loops=1)

12. 0.005 51.034 ↑ 148,196.0 1 1

Nested Loop Left Join (cost=1.00..13,287,353.60 rows=148,196 width=286) (actual time=51.034..51.034 rows=1 loops=1)

  • Join Filter: (cci.cad_commandsid = cc.cad_commandsid)
  • Rows Removed by Join Filter: 65
13. 0.006 50.957 ↑ 148,196.0 1 1

Nested Loop Left Join (cost=1.00..13,142,859.68 rows=148,196 width=91) (actual time=50.957..50.957 rows=1 loops=1)

14. 0.008 50.950 ↑ 148,196.0 1 1

Nested Loop Left Join (cost=0.86..13,094,866.98 rows=148,196 width=83) (actual time=50.950..50.950 rows=1 loops=1)

  • Join Filter: (us.statusid = ul.statusid)
  • Rows Removed by Join Filter: 37
15. 0.182 50.897 ↑ 148,196.0 1 1

Nested Loop (cost=0.86..13,008,169.83 rows=148,196 width=66) (actual time=50.897..50.897 rows=1 loops=1)

  • Join Filter: (ul.loguser = su.userid)
  • Rows Removed by Join Filter: 2,507
16. 0.036 47.077 ↑ 78,616.0 2 1

Nested Loop (cost=0.86..9,319,224.56 rows=157,232 width=49) (actual time=36.972..47.077 rows=2 loops=1)

  • Join Filter: (cfsu.cfsid = c.cfsid)
17. 0.015 38.803 ↑ 163,458.0 2 1

Nested Loop (cost=0.43..9,162,821.72 rows=326,916 width=45) (actual time=36.862..38.803 rows=2 loops=1)

18. 38.708 38.708 ↑ 4,539,919.0 4 1

Seq Scan on yrk_unitlog ul (cost=0.00..770,183.76 rows=18,159,676 width=40) (actual time=36.816..38.708 rows=4 loops=1)

19. 0.080 0.080 ↓ 0.0 0 4

Index Scan using yrk_cfsunit on yrk_callforserviceunit cfsu (cost=0.43..0.45 rows=1 width=9) (actual time=0.019..0.020 rows=0 loops=4)

  • Index Cond: ((cfsid = ul.cfsid) AND (unitid = ul.unitid))
20. 8.238 8.238 ↑ 1.0 1 2

Index Scan using unique_cfsid on yrk_callforservice c (cost=0.43..0.47 rows=1 width=12) (actual time=4.112..4.119 rows=1 loops=2)

  • Index Cond: (cfsid = ul.cfsid)
21. 0.410 3.638 ↑ 1.2 1,254 2

Materialize (cost=0.00..286.46 rows=1,564 width=25) (actual time=0.012..1.819 rows=1,254 loops=2)

22. 3.228 3.228 ↑ 1.0 1,564 1

Seq Scan on yrk_securityuser su (cost=0.00..278.64 rows=1,564 width=25) (actual time=0.017..3.228 rows=1,564 loops=1)

23. 0.013 0.045 ↑ 1.0 38 1

Materialize (cost=0.00..2.58 rows=39 width=21) (actual time=0.022..0.045 rows=38 loops=1)

24. 0.032 0.032 ↑ 1.0 38 1

Seq Scan on yrk_unitstatus us (cost=0.00..2.39 rows=39 width=21) (actual time=0.015..0.032 rows=38 loops=1)

25. 0.001 0.001 ↓ 0.0 0 1

Index Only Scan using cad_commands_pkey on cad_commands cc (cost=0.14..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (cad_commandsid = us.z_description_cad_commands_2)
  • Heap Fetches: 0
26. 0.040 0.072 ↑ 1.0 65 1

Materialize (cost=0.00..2.98 rows=65 width=211) (actual time=0.022..0.072 rows=65 loops=1)

27. 0.032 0.032 ↑ 1.0 65 1

Seq Scan on z_cad_command_info cci (cost=0.00..2.65 rows=65 width=211) (actual time=0.014..0.032 rows=65 loops=1)

28. 0.057 0.057 ↑ 1.0 1 1

Index Scan using stg_combined_incidents_wtrun_convertedid_idx on stg_combined_incidents ci (cost=0.43..0.50 rows=1 width=24) (actual time=0.057..0.057 rows=1 loops=1)

  • Index Cond: ((wtrun = 101) AND (convertedid = c.yrk_callforservice_zid))
29. 0.019 0.019 ↑ 1.0 1 1

Index Scan using yrk_unit1 on yrk_unit u (cost=0.28..0.30 rows=1 width=200) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: (unitid = cfsu.unitid)
30. 0.044 0.155 ↑ 6.1 214 1

Materialize (cost=0.00..72.62 rows=1,311 width=28) (actual time=0.029..0.155 rows=214 loops=1)

31. 0.111 0.111 ↑ 6.1 214 1

Seq Scan on cad_units cu (cost=0.00..66.07 rows=1,311 width=28) (actual time=0.026..0.111 rows=214 loops=1)

  • Filter: active
  • Rows Removed by Filter: 23
32. 0.036 0.036 ↑ 1.0 1 1

Index Only Scan using agencies_pkey on agencies a (cost=0.14..0.17 rows=1 width=8) (actual time=0.036..0.036 rows=1 loops=1)

  • Index Cond: (agenciesid = cu.agenciesid)
  • Heap Fetches: 1
33. 0.002 0.016 ↑ 282.5 4 1

Materialize (cost=0.00..26.95 rows=1,130 width=36) (actual time=0.016..0.016 rows=4 loops=1)

34. 0.014 0.014 ↑ 282.5 4 1

Seq Scan on yrk_unitaction ua (cost=0.00..21.30 rows=1,130 width=36) (actual time=0.014..0.014 rows=4 loops=1)

Planning time : 7.934 ms
Execution time : 51.879 ms