explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3rbD

Settings
# exclusive inclusive rows x rows loops node
1. 14.044 33,324.278 ↓ 3.8 2,763 1

WindowAgg (cost=182.09..23,130.20 rows=730 width=452) (actual time=33,322.783..33,324.278 rows=2,763 loops=1)

2. 28.445 33,310.234 ↓ 3.8 2,763 1

Subquery Scan on tab1 (cost=182.09..23,113.77 rows=730 width=460) (actual time=34.699..33,310.234 rows=2,763 loops=1)

3. 50.990 32,591.195 ↓ 3.8 2,763 1

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

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

Initplan (forHash Join)

5. 0.012 0.012 ↑ 1.0 1 1

Seq Scan on "TabMenuInterno" (cost=0.00..1.58 rows=1 width=32) (actual time=0.012..0.012 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.013..0.013 rows=1 loops=1)

7. 0.009 0.009 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=1)

8. 3.398 192.838 ↓ 3.8 2,763 1

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

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

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

10. 5.850 175.001 ↓ 3.8 2,763 1

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

11. 3.349 155.336 ↓ 3.8 2,763 1

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

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

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

13. 4.689 132.166 ↓ 3.8 2,763 1

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

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

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

15. 4.725 106.060 ↓ 3.8 2,763 1

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

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

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

17. 64.386 64.386 ↓ 3.8 2,763 1

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

  • Filter: (("teacIs_Excluido" IS FALSE) AND ("teacDataInicio" >= $52) AND ("teacDataInicio" <= $53))
  • Rows Removed by Filter: 143758
18. 27.630 27.630 ↑ 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.010..0.010 rows=1 loops=2,763)

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

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

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

Seq Scan on "TabServico" tse (cost=0.00..26.03 rows=803 width=4) (actual time=0.004..0.268 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.842 1.726 ↑ 1.0 2,879 1

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

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

Seq Scan on "TabCliente" tcl (cost=0.00..56.45 rows=2,945 width=8) (actual time=0.005..0.884 rows=2,879 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.010 ↑ 1.0 6 1

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

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

Seq Scan on "TabEmpresa" tem (cost=0.00..1.06 rows=6 width=36) (actual time=0.003..0.004 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.006 0.011 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=36) (actual time=0.011..0.011 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.002..0.005 rows=5 loops=1)

31. 0.063 0.892 ↑ 1.0 265 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
32. 0.163 0.829 ↑ 1.0 265 1

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

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

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

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

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

35. 0.079 0.186 ↑ 1.0 265 1

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

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

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

37. 0.044 0.227 ↑ 1.0 127 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
38. 0.082 0.183 ↑ 1.0 127 1

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

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

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

40. 0.016 0.033 ↑ 1.0 46 1

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

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

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

42.          

SubPlan (forHash Join)

43. 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)

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,989.481 ↑ 1.0 1 2,763

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

46. 15,981.192 15,981.192 ↑ 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.784..5.784 rows=1 loops=2,763)

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

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

48. 15,735.285 15,735.285 ↓ 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.695..5.695 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 314.982 ↑ 1.0 1 2,763

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

51.          

Initplan (forFunction Scan)

52. 221.040 221.040 ↑ 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.079..0.080 rows=1 loops=2,763)

53. 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)

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.739 ↑ 1.0 1 73

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

62.          

Initplan (forResult)

63. 17.155 17.228 ↑ 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.235..0.236 rows=1 loops=73)

64.          

Initplan (forFunction Scan)

65. 0.073 0.073 ↑ 1.0 1 73

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.001..0.001 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 141.702 ↑ 1.0 1 1,243

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

72.          

Initplan (forResult)

73. 135.487 135.487 ↑ 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.109..0.109 rows=1 loops=1,243)

74. 47.210 92.781 ↑ 1.0 1 549

Function Scan on proc_common_countbusinessdays (cost=0.56..0.57 rows=1 width=8) (actual time=0.169..0.169 rows=1 loops=549)

75.          

Initplan (forFunction Scan)

76. 45.018 45.567 ↑ 1.0 1 549

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_4 (cost=0.29..0.30 rows=1 width=8) (actual time=0.083..0.083 rows=1 loops=549)

77.          

Initplan (forFunction Scan)

78. 0.549 0.549 ↑ 1.0 1 549

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

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. 68.634 278.964 ↑ 1.0 1 2,214

Function Scan on proc_common_countbusinessdays proc_common_countbusinessdays_1 (cost=0.56..0.57 rows=1 width=8) (actual time=0.126..0.126 rows=1 loops=2,214)

81.          

Initplan (forFunction Scan)

82. 201.474 203.688 ↑ 1.0 1 2,214

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_5 (cost=0.29..0.30 rows=1 width=8) (actual time=0.092..0.092 rows=1 loops=2,214)

83.          

Initplan (forFunction Scan)

84. 2.214 2.214 ↑ 1.0 1 2,214

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

85. 6.642 6.642 ↑ 1.0 1 2,214

Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=2,214)

86. 60.477 60.480 ↑ 1.0 1 2,520

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

87.          

Initplan (forFunction Scan)

88. 0.003 0.003 ↑ 1.0 1 1

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

89. 28.669 90.639 ↑ 1.0 1 243

Function Scan on proc_common_countbusinessdays proc_common_countbusinessdays_3 (cost=0.56..0.57 rows=1 width=8) (actual time=0.373..0.373 rows=1 loops=243)

90.          

Initplan (forFunction Scan)

91. 0.005 0.005 ↑ 1.0 1 1

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

92. 61.722 61.965 ↑ 1.0 1 243

Function Scan on proc_common_addbusinessdays_byminutes proc_common_addbusinessdays_byminutes_6 (cost=0.29..0.30 rows=1 width=8) (actual time=0.255..0.255 rows=1 loops=243)

93.          

Initplan (forFunction Scan)

94. 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.587 ms
Execution time : 33,325.659 ms