explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ozu

Settings
# exclusive inclusive rows x rows loops node
1. 14.003 32,880.736 ↓ 3.8 2,763 1

WindowAgg (cost=182.09..22,296.17 rows=730 width=444) (actual time=32,879.260..32,880.736 rows=2,763 loops=1)

2. 18.216 32,866.733 ↓ 3.8 2,763 1

Subquery Scan on tab1 (cost=182.09..22,279.75 rows=730 width=452) (actual time=33.710..32,866.733 rows=2,763 loops=1)

3. 45.678 32,519.033 ↓ 3.8 2,763 1

Hash Join (cost=182.09..20,755.87 rows=730 width=404) (actual time=33.273..32,519.033 rows=2,763 loops=1)

  • Hash Cond: (tac."tactuiID" = tui."tuiID")
4.          

Initplan (forHash Join)

5. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on "TabMenuInterno" (cost=0.00..1.58 rows=1 width=32) (actual time=0.013..0.014 rows=1 loops=1)

  • Filter: ("tmiValor" = 'controle_processo'::text)
  • Rows Removed by Filter: 45
6. 0.013 0.013 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=1)

7. 0.005 0.005 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1)

8. 3.220 150.917 ↓ 3.8 2,763 1

Hash Join (cost=132.99..10,586.24 rows=730 width=240) (actual time=2.346..150.917 rows=2,763 loops=1)

  • Hash Cond: (teac."teactsssID" = tsss."tsssID")
9. 6.078 147.688 ↓ 3.8 2,763 1

Nested Loop (cost=131.88..10,575.09 rows=730 width=212) (actual time=2.327..147.688 rows=2,763 loops=1)

10. 5.577 133.321 ↓ 3.8 2,763 1

Nested Loop (cost=131.74..10,443.07 rows=730 width=180) (actual time=2.322..133.321 rows=2,763 loops=1)

11. 3.308 113.929 ↓ 3.8 2,763 1

Hash Join (cost=131.45..9,684.74 rows=730 width=180) (actual time=2.315..113.929 rows=2,763 loops=1)

  • Hash Cond: (tos."tostemID" = tem."temID")
12. 6.487 110.610 ↓ 3.8 2,763 1

Nested Loop (cost=130.32..9,673.57 rows=730 width=152) (actual time=2.296..110.610 rows=2,763 loops=1)

13. 4.543 90.308 ↓ 3.8 2,763 1

Hash Join (cost=130.03..9,038.09 rows=730 width=136) (actual time=2.288..90.308 rows=2,763 loops=1)

  • Hash Cond: (tos."tostclID" = tcl."tclID")
14. 5.611 84.063 ↓ 3.8 2,763 1

Nested Loop (cost=36.77..8,934.79 rows=730 width=132) (actual time=0.553..84.063 rows=2,763 loops=1)

15. 4.396 64.637 ↓ 3.8 2,763 1

Hash Left Join (cost=36.49..8,705.07 rows=730 width=119) (actual time=0.546..64.637 rows=2,763 loops=1)

  • Hash Cond: (tac."tactseID" = tse."tseID")
16. 7.279 59.752 ↓ 3.8 2,763 1

Nested Loop (cost=0.42..8,659.08 rows=730 width=119) (actual time=0.046..59.752 rows=2,763 loops=1)

17. 30.369 30.369 ↓ 3.8 2,763 1

Seq Scan on "TabEtapaAssessoriaCliente" teac (cost=0.00..4,268.41 rows=730 width=65) (actual time=0.035..30.369 rows=2,763 loops=1)

  • Filter: (("teacIs_Excluido" IS FALSE) AND ("teacDataInicio" >= $39) AND ("teacDataInicio" <= $40))
  • Rows Removed by Filter: 143758
18. 22.104 22.104 ↑ 1.0 1 2,763

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac (cost=0.42..6.00 rows=1 width=58) (actual time=0.007..0.008 rows=1 loops=2,763)

  • Index Cond: ("tacID" = teac."teactacID")
19. 0.227 0.489 ↓ 1.0 817 1

Hash (cost=26.03..26.03 rows=803 width=4) (actual time=0.489..0.489 rows=817 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 37kB
20. 0.262 0.262 ↓ 1.0 817 1

Seq Scan on "TabServico" tse (cost=0.00..26.03 rows=803 width=4) (actual time=0.004..0.262 rows=817 loops=1)

21. 13.815 13.815 ↑ 1.0 1 2,763

Index Scan using "TabOrdemServico_tosID" on "TabOrdemServico" tos (cost=0.28..0.30 rows=1 width=17) (actual time=0.004..0.005 rows=1 loops=2,763)

  • Index Cond: ("tosID" = tac."tactosID")
22. 0.872 1.702 ↑ 1.0 2,880 1

Hash (cost=56.45..56.45 rows=2,945 width=8) (actual time=1.702..1.702 rows=2,880 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 145kB
23. 0.830 0.830 ↑ 1.0 2,880 1

Seq Scan on "TabCliente" tcl (cost=0.00..56.45 rows=2,945 width=8) (actual time=0.005..0.830 rows=2,880 loops=1)

24. 13.815 13.815 ↑ 1.0 1 2,763

Index Scan using "TabPessoaID" on "TabPessoa" tpe (cost=0.29..0.86 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=2,763)

  • Index Cond: ("tpeID" = tcl."tcltpeID")
25. 0.006 0.011 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=36) (actual time=0.011..0.011 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.005 0.005 ↑ 1.0 6 1

Seq Scan on "TabEmpresa" tem (cost=0.00..1.06 rows=6 width=36) (actual time=0.003..0.005 rows=6 loops=1)

27. 13.815 13.815 ↑ 1.0 1 2,763

Index Scan using "TabPropostaComercial_tpcID" on "TabPropostaComercial" tpc (cost=0.28..1.03 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=2,763)

  • Index Cond: ("tpcID" = tos."tostpcID")
28. 8.289 8.289 ↑ 1.0 1 2,763

Index Scan using "TabAssessoria_tasID" on "TabAssessoria" tas (cost=0.14..0.17 rows=1 width=40) (actual time=0.002..0.003 rows=1 loops=2,763)

  • Index Cond: ("tasID" = tpc."tpctasID")
29. 0.004 0.009 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=36) (actual time=0.009..0.009 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
30. 0.005 0.005 ↑ 1.0 5 1

Seq Scan on "TabServiceStepState" tsss (cost=0.00..1.05 rows=5 width=36) (actual time=0.003..0.005 rows=5 loops=1)

31. 0.080 0.832 ↑ 1.0 265 1

Hash (cost=44.19..44.19 rows=265 width=4) (actual time=0.832..0.832 rows=265 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
32. 0.156 0.752 ↑ 1.0 265 1

Hash Join (cost=23.60..44.19 rows=265 width=4) (actual time=0.389..0.752 rows=265 loops=1)

  • Hash Cond: (tfu."tfutcfID" = tcf."tcfID")
33. 0.148 0.409 ↑ 1.0 265 1

Hash Join (cost=14.96..31.90 rows=265 width=8) (actual time=0.195..0.409 rows=265 loops=1)

  • Hash Cond: (tfu."tfuID" = tui."tuitfuID")
34. 0.078 0.078 ↑ 1.0 286 1

Seq Scan on "TabFuncionario" tfu (cost=0.00..12.86 rows=286 width=8) (actual time=0.002..0.078 rows=286 loops=1)

35. 0.079 0.183 ↑ 1.0 265 1

Hash (cost=11.65..11.65 rows=265 width=8) (actual time=0.183..0.183 rows=265 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
36. 0.104 0.104 ↑ 1.0 265 1

Seq Scan on "TabUsuarioInterno" tui (cost=0.00..11.65 rows=265 width=8) (actual time=0.003..0.104 rows=265 loops=1)

37. 0.023 0.187 ↑ 1.0 127 1

Hash (cost=7.05..7.05 rows=127 width=4) (actual time=0.187..0.187 rows=127 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
38. 0.109 0.164 ↑ 1.0 127 1

Hash Join (cost=2.04..7.05 rows=127 width=4) (actual time=0.052..0.164 rows=127 loops=1)

  • Hash Cond: (tcf."tcftdeID" = tde."tdeID")
39. 0.021 0.021 ↑ 1.0 127 1

Seq Scan on "TabCargoFuncionario" tcf (cost=0.00..3.27 rows=127 width=8) (actual time=0.009..0.021 rows=127 loops=1)

40. 0.018 0.034 ↑ 1.0 46 1

Hash (cost=1.46..1.46 rows=46 width=4) (actual time=0.033..0.034 rows=46 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
41. 0.016 0.016 ↑ 1.0 46 1

Seq Scan on "TabDepartamento" tde (cost=0.00..1.46 rows=46 width=4) (actual time=0.004..0.016 rows=46 loops=1)

42.          

SubPlan (forHash Join)

43. 11.052 11.052 ↑ 1.0 1 2,763

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=2,763)

44. 5.526 5.526 ↑ 1.0 1 2,763

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=2,763)

45. 8.289 15,862.383 ↑ 1.0 1 2,763

Aggregate (cost=12.75..12.76 rows=1 width=8) (actual time=5.741..5.741 rows=1 loops=2,763)

46. 15,854.094 15,854.094 ↑ 1,000.0 1 2,763

Function Scan on proc_cliente_getsuspensoesassessoria_porminuto (cost=0.25..10.25 rows=1,000 width=4) (actual time=5.738..5.738 rows=1 loops=2,763)

47. 5.526 15,845.805 ↓ 0.0 0 2,763

Limit (cost=0.25..0.26 rows=1 width=8) (actual time=5.734..5.735 rows=0 loops=2,763)

48. 15,840.279 15,840.279 ↓ 0.0 0 2,763

Function Scan on proc_cliente_getsuspensoesassessoria_porminuto proc_cliente_getsuspensoesassessoria_porminuto_1 (cost=0.25..10.25 rows=1,000 width=8) (actual time=5.733..5.733 rows=0 loops=2,763)

49. 270.774 270.774 ↑ 1.0 1 2,763

Function Scan on proc_common_addbusinessdays (cost=0.25..0.26 rows=1 width=4) (actual time=0.098..0.098 rows=1 loops=2,763)

50. 93.942 312.219 ↑ 1.0 1 2,763

Function Scan on proc_common_countbusinessdays proc_common_countbusinessdays_2 (cost=0.52..0.53 rows=1 width=8) (actual time=0.113..0.113 rows=1 loops=2,763)

51.          

Initplan (forFunction Scan)

52. 218.277 218.277 ↑ 1.0 1 2,763

Function Scan on proc_common_addbusinessdays proc_common_addbusinessdays_1 (cost=0.25..0.26 rows=1 width=4) (actual time=0.078..0.079 rows=1 loops=2,763)

53. 13.815 13.815 ↑ 1.0 1 2,763

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=2,763)

54.          

SubPlan (forSubquery Scan)

55. 8.289 8.289 ↑ 1.0 1 2,763

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=2,763)

56. 0.000 0.000 ↓ 0.0 0

Result (cost=0.29..0.31 rows=1 width=32) (never executed)

57.          

Initplan (forResult)

58. 0.000 0.000 ↓ 0.0 0

Function Scan on proc_common_addbusinessdays_byminutes (cost=0.28..0.29 rows=1 width=8) (never executed)

59.          

Initplan (forFunction Scan)

60. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=8) (never executed)

61. 0.511 17.593 ↑ 1.0 1 73

Result (cost=0.30..0.31 rows=1 width=32) (actual time=0.241..0.241 rows=1 loops=73)

62.          

Initplan (forResult)

63. 16.936 17.082 ↑ 1.0 1 73

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_1 (cost=0.29..0.30 rows=1 width=8) (actual time=0.234..0.234 rows=1 loops=73)

64.          

Initplan (forFunction Scan)

65. 0.146 0.146 ↑ 1.0 1 73

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=73)

66. 0.000 0.000 ↓ 0.0 0

Result (cost=0.31..0.32 rows=1 width=32) (never executed)

67.          

Initplan (forResult)

68. 0.000 0.000 ↓ 0.0 0

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_2 (cost=0.30..0.31 rows=1 width=8) (never executed)

69.          

Initplan (forFunction Scan)

70. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=8) (never executed)

71. 6.215 140.459 ↑ 1.0 1 1,243

Result (cost=0.27..0.28 rows=1 width=32) (actual time=0.113..0.113 rows=1 loops=1,243)

72.          

Initplan (forResult)

73. 134.244 134.244 ↑ 1.0 1 1,243

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_3 (cost=0.26..0.27 rows=1 width=8) (actual time=0.108..0.108 rows=1 loops=1,243)

74. 70.556 70.560 ↑ 1.0 1 2,520

Function Scan on proc_common_countbusinessdays (cost=0.27..0.28 rows=1 width=8) (actual time=0.027..0.028 rows=1 loops=2,520)

75.          

Initplan (forFunction Scan)

76. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=1)

77. 28.670 92.583 ↑ 1.0 1 243

Function Scan on proc_common_countbusinessdays proc_common_countbusinessdays_1 (cost=0.56..0.57 rows=1 width=8) (actual time=0.380..0.381 rows=1 loops=243)

78.          

Initplan (forFunction Scan)

79. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=1)

80. 63.666 63.909 ↑ 1.0 1 243

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_4 (cost=0.29..0.30 rows=1 width=8) (actual time=0.262..0.263 rows=1 loops=243)

81.          

Initplan (forFunction Scan)

82. 0.243 0.243 ↑ 1.0 1 243

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=243)

Planning time : 5.247 ms
Execution time : 32,882.086 ms