explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GEkN

Settings
# exclusive inclusive rows x rows loops node
1. 0.133 5,456.391 ↓ 2.8 39 1

Sort (cost=216,355.21..216,355.25 rows=14 width=340) (actual time=5,456.390..5,456.391 rows=39 loops=1)

  • Sort Key: ((date_part('year'::text, "*SELECT* 1".datahora))::integer), ((date_part('month'::text, "*SELECT* 1".datahora))::integer), ((date_part('day'::text, "*SELECT* 1".datahora))::integer), "*SELECT* 1".entidade_id, "*SELECT* 1".codigo, "*SELECT* 1".datahora
  • Sort Method: quicksort Memory: 30kB
2. 0.349 5,456.258 ↓ 2.8 39 1

Result (cost=122.14..216,354.95 rows=14 width=340) (actual time=4.640..5,456.258 rows=39 loops=1)

3. 0.008 5,455.909 ↓ 2.8 39 1

Append (cost=122.14..216,354.63 rows=14 width=340) (actual time=4.421..5,455.909 rows=39 loops=1)

4. 0.002 4.427 ↓ 2.0 2 1

Subquery Scan on *SELECT* 1 (cost=122.14..122.25 rows=1 width=331) (actual time=4.421..4.427 rows=2 loops=1)

5. 0.021 4.425 ↓ 2.0 2 1

Hash Right Join (cost=122.14..122.24 rows=1 width=331) (actual time=4.420..4.425 rows=2 loops=1)

  • Hash Cond: (prodvendas_pv.codprevenda = vendas_pv.codigo)
6.          

CTE vendas_pv

7. 0.017 4.287 ↓ 2.0 2 1

GroupAggregate (cost=111.32..111.36 rows=1 width=27) (actual time=4.285..4.287 rows=2 loops=1)

  • Group Key: pv.codigo, pv.valortotal, pf.datahora
8. 0.028 4.270 ↓ 2.0 2 1

Sort (cost=111.32..111.32 rows=1 width=27) (actual time=4.270..4.270 rows=2 loops=1)

  • Sort Key: pv.codigo, pv.valortotal, pf.datahora
  • Sort Method: quicksort Memory: 25kB
9. 0.004 4.242 ↓ 2.0 2 1

Nested Loop Left Join (cost=1.58..111.31 rows=1 width=27) (actual time=3.765..4.242 rows=2 loops=1)

10. 0.004 4.230 ↓ 2.0 2 1

Nested Loop Left Join (cost=1.29..102.99 rows=1 width=19) (actual time=3.759..4.230 rows=2 loops=1)

11. 4.018 4.174 ↓ 2.0 2 1

Nested Loop Left Join (cost=0.85..94.49 rows=1 width=31) (actual time=3.746..4.174 rows=2 loops=1)

12. 0.008 0.108 ↓ 2.0 2 1

Nested Loop (cost=0.58..85.94 rows=1 width=25) (actual time=0.039..0.108 rows=2 loops=1)

13. 0.044 0.044 ↑ 1.8 4 1

Index Scan using prevendas_codcliente_unique on prevendas pv (cost=0.29..27.54 rows=7 width=45) (actual time=0.022..0.044 rows=4 loops=1)

  • Index Cond: (codcliente = 2)
14. 0.056 0.056 ↑ 1.0 1 4

Index Scan using prevendas_faturamento_pkey on prevendas_faturamento (cost=0.29..8.33 rows=1 width=4) (actual time=0.014..0.014 rows=1 loops=4)

  • Index Cond: ((codprevenda = pv.codigo) AND (codprevenda IS NOT NULL))
  • Filter: (((datahora)::date >= ('01/01/0001'::cstring)::date) AND ((datahora)::date <= ('31/12/9999'::cstring)::date))
15. 0.048 0.048 ↑ 1.0 1 2

Index Scan using configuracoes_pkey on configuracoes (cost=0.27..8.29 rows=1 width=6) (actual time=0.024..0.024 rows=1 loops=2)

  • Index Cond: (parametro = 'DDIPADRAO'::text)
16. 0.006 0.052 ↑ 1.0 1 2

Nested Loop Left Join (cost=0.43..8.48 rows=1 width=14) (actual time=0.025..0.026 rows=1 loops=2)

17. 0.040 0.040 ↑ 1.0 1 2

Index Scan using prevenda_pagto_codprevenda_index on prevenda_pagto pvpg (cost=0.29..8.31 rows=1 width=17) (actual time=0.020..0.020 rows=1 loops=2)

  • Index Cond: (pv.codigo = codprevenda)
18. 0.006 0.006 ↑ 1.0 1 2

Index Scan using formapagto_finalizadora_pkey on formapagto_finalizadora fpf (cost=0.14..0.16 rows=1 width=9) (actual time=0.002..0.003 rows=1 loops=2)

  • Index Cond: (pvpg.codformapagtofinalizadora = codigo)
19. 0.008 0.008 ↑ 1.0 1 2

Index Scan using prevendas_faturamento_pkey on prevendas_faturamento pf (cost=0.29..8.31 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=2)

  • Index Cond: (pv.codigo = codprevenda)
20.          

CTE prodvendas_pv

21. 0.001 0.099 ↑ 2.0 2 1

Unique (cost=10.73..10.75 rows=4 width=36) (actual time=0.098..0.099 rows=2 loops=1)

22. 0.008 0.098 ↑ 2.0 2 1

Sort (cost=10.73..10.74 rows=4 width=36) (actual time=0.097..0.098 rows=2 loops=1)

  • Sort Key: pp.codprevenda, (sum(pp.valortotal) OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
23. 0.013 0.090 ↑ 2.0 2 1

WindowAgg (cost=10.61..10.69 rows=4 width=36) (actual time=0.087..0.090 rows=2 loops=1)

24. 0.003 0.077 ↑ 2.0 2 1

Sort (cost=10.61..10.62 rows=4 width=36) (actual time=0.077..0.077 rows=2 loops=1)

  • Sort Key: pp.codprevenda, gp.codigo
  • Sort Method: quicksort Memory: 25kB
25. 0.002 0.074 ↑ 2.0 2 1

Nested Loop (cost=0.87..10.57 rows=4 width=36) (actual time=0.036..0.074 rows=2 loops=1)

26. 0.003 0.068 ↑ 2.0 2 1

Nested Loop (cost=0.73..9.88 rows=4 width=13) (actual time=0.032..0.068 rows=2 loops=1)

27. 0.003 0.025 ↑ 2.0 2 1

Nested Loop (cost=0.44..8.59 rows=4 width=13) (actual time=0.011..0.025 rows=2 loops=1)

28. 0.003 0.004 ↓ 2.0 2 1

HashAggregate (cost=0.02..0.03 rows=1 width=4) (actual time=0.004..0.004 rows=2 loops=1)

  • Group Key: vendas_pv_1.codigo
29. 0.001 0.001 ↓ 2.0 2 1

CTE Scan on vendas_pv vendas_pv_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.000..0.001 rows=2 loops=1)

30. 0.018 0.018 ↑ 4.0 1 2

Index Scan using prevendasprod_codprevenda_index on prevendasprod pp (cost=0.42..8.51 rows=4 width=13) (actual time=0.009..0.009 rows=1 loops=2)

  • Index Cond: (codprevenda = vendas_pv_1.codigo)
31. 0.040 0.040 ↑ 1.0 1 2

Index Scan using produtos_codigo_index on produtos prod (cost=0.29..0.31 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=2)

  • Index Cond: (codigo = pp.codproduto)
32. 0.004 0.004 ↑ 1.0 1 2

Index Scan using grupos_pkey on grupos gp (cost=0.14..0.16 rows=1 width=27) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (codigo = prod.codgrupo)
33. 0.101 0.101 ↑ 2.0 2 1

CTE Scan on prodvendas_pv (cost=0.00..0.08 rows=4 width=102) (actual time=0.099..0.101 rows=2 loops=1)

34. 0.012 4.303 ↓ 2.0 2 1

Hash (cost=0.02..0.02 rows=1 width=233) (actual time=4.303..4.303 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 4.291 4.291 ↓ 2.0 2 1

CTE Scan on vendas_pv (cost=0.00..0.02 rows=1 width=233) (actual time=4.287..4.291 rows=2 loops=1)

36. 0.001 0.467 ↑ 1.0 1 1

Subquery Scan on *SELECT* 2 (cost=57.94..58.15 rows=1 width=331) (actual time=0.464..0.467 rows=1 loops=1)

37. 0.014 0.466 ↑ 1.0 1 1

Hash Right Join (cost=57.94..58.14 rows=1 width=331) (actual time=0.463..0.466 rows=1 loops=1)

  • Hash Cond: (prodvendas_snf.codigonf = vendas_snf.codigo)
38.          

CTE vendas_snf

39. 0.007 0.367 ↑ 1.0 1 1

GroupAggregate (cost=37.35..37.39 rows=1 width=29) (actual time=0.367..0.367 rows=1 loops=1)

  • Group Key: s.codigo, s.valortotalnota, fat.datahora, spg.qtdeparcelas
40. 0.015 0.360 ↑ 1.0 1 1

Sort (cost=37.35..37.35 rows=1 width=29) (actual time=0.360..0.360 rows=1 loops=1)

  • Sort Key: s.codigo, s.valortotalnota, fat.datahora, spg.qtdeparcelas
  • Sort Method: quicksort Memory: 25kB
41. 0.001 0.345 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.00..37.34 rows=1 width=29) (actual time=0.341..0.345 rows=1 loops=1)

42. 0.003 0.052 ↑ 1.0 1 1

Nested Loop (cost=0.44..28.48 rows=1 width=18) (actual time=0.050..0.052 rows=1 loops=1)

43. 0.015 0.015 ↑ 2.0 1 1

Index Scan using saidasnf_codcliente_index on saidasnf s (cost=0.29..12.08 rows=2 width=26) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (codcliente = 2)
44. 0.034 0.034 ↑ 1.0 1 1

Index Scan using saidasnf_faturamento_pkey on saidasnf_faturamento fat (cost=0.15..8.19 rows=1 width=12) (actual time=0.033..0.034 rows=1 loops=1)

  • Index Cond: ((codsaidasnf = s.codigo) AND (codsaidasnf IS NOT NULL))
  • Filter: (((datahora)::date >= ('01/01/0001'::cstring)::date) AND ((datahora)::date <= ('31/12/9999'::cstring)::date))
45. 0.002 0.292 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.56..8.85 rows=1 width=15) (actual time=0.289..0.292 rows=1 loops=1)

46. 0.005 0.005 ↑ 1.0 1 1

Index Scan using saidasnf_pagto_codsaidasnf_index on saidasnf_pagto spg (cost=0.29..8.30 rows=1 width=18) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (s.codigo = codsaidasnf)
47. 0.005 0.285 ↑ 1.0 1 1

Nested Loop (cost=0.28..0.53 rows=1 width=5) (actual time=0.283..0.285 rows=1 loops=1)

48. 0.003 0.003 ↑ 1.0 1 1

Index Scan using formapagto_finalizadora_pkey on formapagto_finalizadora fpf_1 (cost=0.14..0.16 rows=1 width=9) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (codigo = spg.codformapagtofinalizadora)
49. 0.277 0.277 ↑ 1.0 1 1

Index Only Scan using tipodocumento_pkey on tipodocumento tdoc (cost=0.14..0.37 rows=1 width=4) (actual time=0.276..0.277 rows=1 loops=1)

  • Index Cond: (codigo = fpf_1.codfinalizadora)
  • Heap Fetches: 1
50.          

CTE prodvendas_snf

51. 0.011 0.068 ↑ 8.0 1 1

Sort (cost=20.50..20.52 rows=8 width=37) (actual time=0.068..0.068 rows=1 loops=1)

  • Sort Key: spnf.codigonf, (sum(spnf.valortotal) OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
52. 0.010 0.057 ↑ 8.0 1 1

WindowAgg (cost=20.22..20.38 rows=8 width=37) (actual time=0.055..0.057 rows=1 loops=1)

53. 0.010 0.047 ↑ 8.0 1 1

Sort (cost=20.22..20.24 rows=8 width=37) (actual time=0.047..0.047 rows=1 loops=1)

  • Sort Key: spnf.codigonf, gp_1.codigo
  • Sort Method: quicksort Memory: 25kB
54. 0.002 0.037 ↑ 8.0 1 1

Nested Loop (cost=0.87..20.10 rows=8 width=37) (actual time=0.036..0.037 rows=1 loops=1)

55. 0.001 0.032 ↑ 8.0 1 1

Nested Loop (cost=0.73..18.73 rows=8 width=14) (actual time=0.032..0.032 rows=1 loops=1)

56. 0.002 0.025 ↑ 8.0 1 1

Nested Loop (cost=0.44..16.07 rows=8 width=14) (actual time=0.025..0.025 rows=1 loops=1)

57. 0.003 0.004 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Group Key: vendas_snf_1.codigo
58. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on vendas_snf vendas_snf_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

59. 0.019 0.019 ↑ 8.0 1 1

Index Scan using saidasprodnf_codigonf_idx on saidasprodnf spnf (cost=0.42..15.96 rows=8 width=14) (actual time=0.018..0.019 rows=1 loops=1)

  • Index Cond: (codigonf = vendas_snf_1.codigo)
60. 0.006 0.006 ↑ 1.0 1 1

Index Scan using produtos_codigo_index on produtos prod_1 (cost=0.29..0.32 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (codigo = spnf.codproduto)
61. 0.003 0.003 ↑ 1.0 1 1

Index Scan using grupos_pkey on grupos gp_1 (cost=0.14..0.16 rows=1 width=27) (actual time=0.002..0.003 rows=1 loops=1)

  • Index Cond: (codigo = prod_1.codgrupo)
62. 0.070 0.070 ↑ 8.0 1 1

CTE Scan on prodvendas_snf (cost=0.00..0.16 rows=8 width=102) (actual time=0.069..0.070 rows=1 loops=1)

63. 0.012 0.382 ↑ 1.0 1 1

Hash (cost=0.02..0.02 rows=1 width=233) (actual time=0.382..0.382 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
64. 0.370 0.370 ↑ 1.0 1 1

CTE Scan on vendas_snf (cost=0.00..0.02 rows=1 width=233) (actual time=0.369..0.370 rows=1 loops=1)

65. 0.011 5,450.532 ↓ 3.4 34 1

Subquery Scan on *SELECT* 3 (cost=216,006.30..216,006.70 rows=10 width=345) (actual time=1,226.398..5,450.532 rows=34 loops=1)

66. 0.006 5,450.521 ↓ 3.4 34 1

Append (cost=216,006.30..216,006.60 rows=10 width=341) (actual time=1,226.397..5,450.521 rows=34 loops=1)

67.          

CTE contas

68. 0.049 1,306.501 ↓ 6.4 32 1

Nested Loop Left Join (cost=97,088.51..107,211.04 rows=5 width=127) (actual time=1,226.393..1,306.501 rows=32 loops=1)

69. 0.027 1,306.420 ↓ 6.4 32 1

Hash Left Join (cost=97,088.38..107,210.22 rows=5 width=122) (actual time=1,226.370..1,306.420 rows=32 loops=1)

  • Hash Cond: (cr.codigo = vspc.codigo)
70. 0.006 1,304.691 ↓ 6.4 32 1

Nested Loop (cost=94,832.11..104,953.91 rows=5 width=90) (actual time=1,224.655..1,304.691 rows=32 loops=1)

71. 0.030 1,304.493 ↑ 32.1 32 1

Hash Left Join (cost=94,831.69..104,440.29 rows=1,027 width=86) (actual time=1,224.624..1,304.493 rows=32 loops=1)

  • Hash Cond: (cr.codigo = vppc.codigo)
72. 0.033 1,107.556 ↑ 32.1 32 1

Hash Left Join (cost=78,538.59..88,141.94 rows=1,027 width=54) (actual time=1,027.701..1,107.556 rows=32 loops=1)

  • Hash Cond: (cr_sit.situacoesconta_codigo = sc.codigo)
73. 0.017 1,107.516 ↑ 32.1 32 1

Nested Loop Left Join (cost=78,537.45..88,126.68 rows=1,027 width=57) (actual time=1,027.677..1,107.516 rows=32 loops=1)

74. 10.429 1,107.403 ↑ 32.1 32 1

Hash Right Join (cost=78,537.03..87,637.59 rows=1,027 width=53) (actual time=1,027.652..1,107.403 rows=32 loops=1)

  • Hash Cond: (cr_1.codigo = cr.codigo)
75. 60.651 473.112 ↑ 1.0 177,399 1

WindowAgg (cost=46,733.88..53,386.34 rows=177,399 width=16) (actual time=403.776..473.112 rows=177,399 loops=1)

76. 154.433 412.461 ↑ 1.0 177,399 1

Sort (cost=46,733.88..47,177.37 rows=177,399 width=16) (actual time=403.759..412.461 rows=177,399 loops=1)

  • Sort Key: crav_crav_lotes.contasareceber_avulsas_lotes_codigo, cr_1.datavencimento, cr_1.codigo
  • Sort Method: quicksort Memory: 14462kB
77. 62.737 258.028 ↑ 1.0 177,399 1

WindowAgg (cost=28,163.18..31,267.67 rows=177,399 width=16) (actual time=188.739..258.028 rows=177,399 loops=1)

78. 36.618 195.291 ↑ 1.0 177,399 1

Sort (cost=28,163.18..28,606.68 rows=177,399 width=16) (actual time=188.731..195.291 rows=177,399 loops=1)

  • Sort Key: crav_crav_lotes.contasareceber_avulsas_lotes_codigo
  • Sort Method: quicksort Memory: 14460kB
79. 18.304 158.673 ↑ 1.0 177,399 1

Hash Left Join (cost=4,953.67..12,696.97 rows=177,399 width=16) (actual time=52.712..158.673 rows=177,399 loops=1)

  • Hash Cond: (cra.codigo = crav_crav_lotes.contasareceber_avulsas_codigo)
80. 77.756 140.348 ↑ 1.0 177,399 1

Hash Join (cost=4,951.48..12,029.00 rows=177,399 width=12) (actual time=52.677..140.348 rows=177,399 loops=1)

  • Hash Cond: (cr_1.codigo = cra.contasareceber_codigo)
81. 11.068 11.068 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr_1 (cost=0.00..4,532.39 rows=205,639 width=16) (actual time=0.001..11.068 rows=205,641 loops=1)

82. 34.774 51.524 ↑ 1.0 177,399 1

Hash (cost=2,733.99..2,733.99 rows=177,399 width=8) (actual time=51.524..51.524 rows=177,399 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 8978kB
83. 16.750 16.750 ↑ 1.0 177,399 1

Seq Scan on contasareceber_avulsas cra (cost=0.00..2,733.99 rows=177,399 width=8) (actual time=0.003..16.750 rows=177,399 loops=1)

84. 0.014 0.021 ↑ 1.0 53 1

Hash (cost=1.53..1.53 rows=53 width=8) (actual time=0.021..0.021 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
85. 0.007 0.007 ↑ 1.0 53 1

Seq Scan on contasareceber_avulsas_contasareceber_avulsas_lotes crav_crav_lotes (cost=0.00..1.53 rows=53 width=8) (actual time=0.002..0.007 rows=53 loops=1)

86. 0.027 623.862 ↑ 32.1 32 1

Hash (cost=31,790.32..31,790.32 rows=1,027 width=21) (actual time=623.862..623.862 rows=32 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 18kB
87. 69.786 623.835 ↑ 32.1 32 1

Hash Left Join (cost=19,623.62..31,790.32 rows=1,027 width=21) (actual time=623.774..623.835 rows=32 loops=1)

  • Hash Cond: (cr.codigo = crav.contasareceber_codigo)
  • Filter: (((pvpg_1.codprevenda IS NOT NULL) OR (crav.codigo IS NOT NULL) OR (snfpg.codsaidasnf IS NOT NULL)) AND (CASE WHEN (crav.clientes_codigo IS NOT NULL) THEN crav.clientes_codigo WHEN (pv_1.codcliente IS NOT NULL) THEN pv_1.codcliente WHEN (snf.codcliente IS NOT NULL) THEN snf.codcliente ELSE NULL::integer END = 2))
  • Rows Removed by Filter: 205416
88. 48.753 486.442 ↓ 1.0 205,448 1

Hash Left Join (cost=14,672.14..23,853.06 rows=205,443 width=37) (actual time=295.338..486.442 rows=205,448 loops=1)

  • Hash Cond: (cr.codigo = pvpg_cr.contasareceber_codigo)
89. 24.327 217.975 ↓ 1.0 205,448 1

Hash Left Join (cost=6,428.25..14,558.39 rows=205,443 width=29) (actual time=75.464..217.975 rows=205,448 loops=1)

  • Hash Cond: (cr.codigo = snfpg_cr.contasareceber_codigo)
90. 106.392 189.284 ↓ 1.0 205,448 1

Hash Join (cost=5,733.47..13,091.43 rows=205,443 width=21) (actual time=71.082..189.284 rows=205,448 loops=1)

  • Hash Cond: (cr.codigo = cr_fat.contasareceber_codigo)
91. 13.144 13.144 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr (cost=0.00..4,532.39 rows=205,639 width=21) (actual time=0.008..13.144 rows=205,641 loops=1)

92. 39.497 69.748 ↓ 1.0 205,448 1

Hash (cost=3,165.43..3,165.43 rows=205,443 width=4) (actual time=69.748..69.748 rows=205,448 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9271kB
93. 30.251 30.251 ↓ 1.0 205,448 1

Seq Scan on contasareceber_faturamentos cr_fat (cost=0.00..3,165.43 rows=205,443 width=4) (actual time=0.010..30.251 rows=205,448 loops=1)

  • Filter: (contasareceber_codigo IS NOT NULL)
94. 0.058 4.364 ↓ 1.0 178 1

Hash (cost=692.58..692.58 rows=176 width=12) (actual time=4.364..4.364 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
95. 0.000 4.306 ↓ 1.0 178 1

Nested Loop Left Join (cost=5.25..692.58 rows=176 width=12) (actual time=2.790..4.306 rows=178 loops=1)

96. 2.223 3.776 ↓ 1.0 178 1

Hash Right Join (cost=4.96..605.16 rows=176 width=8) (actual time=2.771..3.776 rows=178 loops=1)

  • Hash Cond: (snfpg.codigo = snfpg_cr.saidasnf_pagtos_codigo)
97. 1.508 1.508 ↓ 1.0 22,125 1

Seq Scan on saidasnf_pagto snfpg (cost=0.00..377.22 rows=22,122 width=8) (actual time=0.005..1.508 rows=22,125 loops=1)

98. 0.025 0.045 ↓ 1.0 178 1

Hash (cost=2.76..2.76 rows=176 width=8) (actual time=0.045..0.045 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
99. 0.020 0.020 ↓ 1.0 178 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..2.76 rows=176 width=8) (actual time=0.006..0.020 rows=178 loops=1)

100. 0.534 0.534 ↑ 1.0 1 178

Index Scan using saidasnf_codigo_index on saidasnf snf (cost=0.29..0.49 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=178)

  • Index Cond: (snfpg.codsaidasnf = codigo)
101. 6.126 219.714 ↑ 1.0 28,064 1

Hash (cost=7,893.09..7,893.09 rows=28,064 width=12) (actual time=219.714..219.714 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1462kB
102. 32.708 213.588 ↑ 1.0 28,064 1

Hash Right Join (cost=3,859.05..7,893.09 rows=28,064 width=12) (actual time=174.372..213.588 rows=28,064 loops=1)

  • Hash Cond: (pv_1.codigo = pvpg_1.codprevenda)
103. 6.669 6.669 ↓ 1.0 91,561 1

Seq Scan on prevendas pv_1 (cost=0.00..3,295.60 rows=91,560 width=8) (actual time=0.001..6.669 rows=91,561 loops=1)

104. 5.095 174.211 ↑ 1.0 28,064 1

Hash (cost=3,508.25..3,508.25 rows=28,064 width=8) (actual time=174.211..174.211 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
105. 14.780 169.116 ↑ 1.0 28,064 1

Hash Left Join (cost=2,716.73..3,508.25 rows=28,064 width=8) (actual time=153.063..169.116 rows=28,064 loops=1)

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg_1.codigo)
106. 1.904 1.904 ↑ 1.0 28,064 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr (cost=0.00..405.64 rows=28,064 width=8) (actual time=0.005..1.904 rows=28,064 loops=1)

107. 111.876 152.432 ↓ 1.0 93,501 1

Hash (cost=1,547.99..1,547.99 rows=93,499 width=8) (actual time=152.432..152.432 rows=93,501 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
108. 40.556 40.556 ↓ 1.0 93,501 1

Seq Scan on prevenda_pagto pvpg_1 (cost=0.00..1,547.99 rows=93,499 width=8) (actual time=0.005..40.556 rows=93,501 loops=1)

109. 40.250 67.607 ↑ 1.0 177,399 1

Hash (cost=2,733.99..2,733.99 rows=177,399 width=12) (actual time=67.607..67.607 rows=177,399 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9671kB
110. 27.357 27.357 ↑ 1.0 177,399 1

Seq Scan on contasareceber_avulsas crav (cost=0.00..2,733.99 rows=177,399 width=12) (actual time=0.028..27.357 rows=177,399 loops=1)

111. 0.096 0.096 ↑ 1.0 1 32

Index Scan using contasareceber_contasareceber_codigo_index on contasareceber_situacao cr_sit (cost=0.42..0.47 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=32)

  • Index Cond: (cr.codigo = contasareceber_codigo)
112. 0.003 0.007 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=5) (actual time=0.007..0.007 rows=6 loops=1)

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

Seq Scan on situacoescontas sc (cost=0.00..1.06 rows=6 width=5) (actual time=0.002..0.004 rows=6 loops=1)

114. 6.067 196.907 ↑ 1.0 28,064 1

Hash (cost=15,942.30..15,942.30 rows=28,064 width=36) (actual time=196.907..196.907 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
115. 3.651 190.840 ↑ 1.0 28,064 1

Subquery Scan on vppc (cost=14,539.10..15,942.30 rows=28,064 width=36) (actual time=160.727..190.840 rows=28,064 loops=1)

116. 25.203 187.189 ↑ 1.0 28,064 1

WindowAgg (cost=14,539.10..15,661.66 rows=28,064 width=16) (actual time=160.726..187.189 rows=28,064 loops=1)

117. 10.202 161.986 ↑ 1.0 28,064 1

Sort (cost=14,539.10..14,609.26 rows=28,064 width=16) (actual time=160.698..161.986 rows=28,064 loops=1)

  • Sort Key: pvpg_cr_1.prevendas_pagtos_codigo, fpf_2.codfinalizadora, cr_2.datavencimento, cr_2.codigo
  • Sort Method: quicksort Memory: 2961kB
118. 18.840 151.784 ↑ 1.0 28,064 1

WindowAgg (cost=11,904.39..12,465.67 rows=28,064 width=16) (actual time=131.806..151.784 rows=28,064 loops=1)

119. 14.608 132.944 ↑ 1.0 28,064 1

Sort (cost=11,904.39..11,974.55 rows=28,064 width=16) (actual time=131.796..132.944 rows=28,064 loops=1)

  • Sort Key: pvpg_cr_1.prevendas_pagtos_codigo, fpf_2.codfinalizadora
  • Sort Method: quicksort Memory: 2084kB
120. 4.895 118.336 ↑ 1.0 28,064 1

Hash Left Join (cost=3,475.02..9,830.96 rows=28,064 width=16) (actual time=35.932..118.336 rows=28,064 loops=1)

  • Hash Cond: (pvpg_2.codformapagtofinalizadora = fpf_2.codigo)
121. 12.992 113.431 ↑ 1.0 28,064 1

Hash Join (cost=3,473.17..9,443.22 rows=28,064 width=16) (actual time=35.908..113.431 rows=28,064 loops=1)

  • Hash Cond: (pvpg_cr_1.prevendas_pagtos_codigo = pvpg_2.codigo)
122. 52.300 71.673 ↑ 1.0 28,064 1

Hash Join (cost=756.44..6,340.62 rows=28,064 width=12) (actual time=6.517..71.673 rows=28,064 loops=1)

  • Hash Cond: (cr_2.codigo = pvpg_cr_1.contasareceber_codigo)
123. 12.934 12.934 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr_2 (cost=0.00..4,532.39 rows=205,639 width=12) (actual time=0.002..12.934 rows=205,641 loops=1)

124. 4.791 6.439 ↑ 1.0 28,064 1

Hash (cost=405.64..405.64 rows=28,064 width=8) (actual time=6.439..6.439 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
125. 1.648 1.648 ↑ 1.0 28,064 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr_1 (cost=0.00..405.64 rows=28,064 width=8) (actual time=0.003..1.648 rows=28,064 loops=1)

126. 17.298 28.766 ↓ 1.0 93,501 1

Hash (cost=1,547.99..1,547.99 rows=93,499 width=8) (actual time=28.766..28.766 rows=93,501 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
127. 11.468 11.468 ↓ 1.0 93,501 1

Seq Scan on prevenda_pagto pvpg_2 (cost=0.00..1,547.99 rows=93,499 width=8) (actual time=0.003..11.468 rows=93,501 loops=1)

  • Filter: (codprevenda IS NOT NULL)
128. 0.005 0.010 ↑ 1.0 38 1

Hash (cost=1.38..1.38 rows=38 width=8) (actual time=0.010..0.010 rows=38 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
129. 0.005 0.005 ↑ 1.0 38 1

Seq Scan on formapagto_finalizadora fpf_2 (cost=0.00..1.38 rows=38 width=8) (actual time=0.001..0.005 rows=38 loops=1)

130. 0.192 0.192 ↑ 1.0 1 32

Index Scan using contasareceber_faturamentos_pkey on contasareceber_faturamentos cf (cost=0.42..0.49 rows=1 width=12) (actual time=0.005..0.006 rows=1 loops=32)

  • Index Cond: (contasareceber_codigo = cr.codigo)
  • Filter: (((dhfaturamento)::date >= ('01/01/0001'::cstring)::date) AND ((dhfaturamento)::date <= ('31/12/9999'::cstring)::date))
131. 0.041 1.702 ↓ 1.0 178 1

Hash (cost=2,254.08..2,254.08 rows=176 width=36) (actual time=1.702..1.702 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
132. 0.027 1.661 ↓ 1.0 178 1

Subquery Scan on vspc (cost=2,245.28..2,254.08 rows=176 width=36) (actual time=1.468..1.661 rows=178 loops=1)

133. 0.166 1.634 ↓ 1.0 178 1

WindowAgg (cost=2,245.28..2,252.32 rows=176 width=16) (actual time=1.467..1.634 rows=178 loops=1)

134. 0.053 1.468 ↓ 1.0 178 1

Sort (cost=2,245.28..2,245.72 rows=176 width=16) (actual time=1.460..1.468 rows=178 loops=1)

  • Sort Key: snfpg_cr_1.saidasnf_pagtos_codigo, fpf_3.codfinalizadora, cr_3.datavencimento, cr_3.codigo
  • Sort Method: quicksort Memory: 38kB
135. 0.125 1.415 ↓ 1.0 178 1

WindowAgg (cost=2,235.19..2,238.71 rows=176 width=16) (actual time=1.291..1.415 rows=178 loops=1)

136. 0.051 1.290 ↓ 1.0 178 1

Sort (cost=2,235.19..2,235.63 rows=176 width=16) (actual time=1.286..1.290 rows=178 loops=1)

  • Sort Key: snfpg_cr_1.saidasnf_pagtos_codigo, fpf_3.codfinalizadora
  • Sort Method: quicksort Memory: 33kB
137. 0.022 1.239 ↓ 1.0 178 1

Nested Loop (cost=0.98..2,228.63 rows=176 width=16) (actual time=0.045..1.239 rows=178 loops=1)

138. 0.131 0.861 ↓ 1.0 178 1

Nested Loop Left Join (cost=0.56..857.87 rows=176 width=12) (actual time=0.030..0.861 rows=178 loops=1)

139. 0.018 0.018 ↓ 1.0 178 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr_1 (cost=0.00..2.76 rows=176 width=8) (actual time=0.005..0.018 rows=178 loops=1)

140. 0.000 0.712 ↑ 1.0 1 178

Nested Loop Left Join (cost=0.56..4.85 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=178)

141. 0.356 0.356 ↑ 1.0 1 178

Index Scan using saidasnf_pagto_pkey on saidasnf_pagto spg_1 (cost=0.29..4.30 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=178)

  • Index Cond: (codigo = snfpg_cr_1.saidasnf_pagtos_codigo)
142. 0.000 0.356 ↑ 1.0 1 178

Nested Loop (cost=0.28..0.53 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=178)

143. 0.178 0.178 ↑ 1.0 1 178

Index Scan using formapagto_finalizadora_pkey on formapagto_finalizadora fpf_3 (cost=0.14..0.16 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (codigo = spg_1.codformapagtofinalizadora)
144. 0.178 0.178 ↑ 1.0 1 178

Index Only Scan using tipodocumento_pkey on tipodocumento tdoc_1 (cost=0.14..0.37 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (codigo = fpf_3.codfinalizadora)
  • Heap Fetches: 178
145. 0.356 0.356 ↑ 1.0 1 178

Index Scan using contasareceber_pkey1 on contasareceber cr_3 (cost=0.42..7.78 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=178)

  • Index Cond: (codigo = snfpg_cr_1.contasareceber_codigo)
146. 0.032 0.032 ↓ 0.0 0 32

Index Scan using gruposcontas_pkey on gruposcontas gc (cost=0.13..0.15 rows=1 width=13) (actual time=0.001..0.001 rows=0 loops=32)

  • Index Cond: (cr.gruposcontas_codigo = codigo)
147.          

CTE recebimentos

148. 0.005 4,143.973 ↑ 2.5 2 1

Nested Loop Left Join (cost=99,702.80..108,795.26 rows=5 width=213) (actual time=4,143.966..4,143.973 rows=2 loops=1)

149. 0.015 4,143.968 ↑ 2.5 2 1

Hash Left Join (cost=99,702.67..108,794.47 rows=5 width=208) (actual time=4,143.962..4,143.968 rows=2 loops=1)

  • Hash Cond: (cr_4.codigo = vspc_1.codigo)
150. 0.024 4,142.421 ↑ 2.5 2 1

Hash Left Join (cost=97,446.39..106,538.16 rows=5 width=176) (actual time=4,142.416..4,142.421 rows=2 loops=1)

  • Hash Cond: (cr_4.codigo = vppc_1.codigo)
151. 10.751 3,969.898 ↑ 2.5 2 1

Hash Right Join (cost=81,153.30..90,245.04 rows=5 width=144) (actual time=3,969.894..3,969.898 rows=2 loops=1)

  • Hash Cond: (cr_5.codigo = cr_4.codigo)
152. 61.066 475.268 ↑ 1.0 177,399 1

WindowAgg (cost=46,733.88..53,386.34 rows=177,399 width=16) (actual time=406.935..475.268 rows=177,399 loops=1)

153. 162.948 414.202 ↑ 1.0 177,399 1

Sort (cost=46,733.88..47,177.37 rows=177,399 width=16) (actual time=406.918..414.202 rows=177,399 loops=1)

  • Sort Key: crav_crav_lotes_1.contasareceber_avulsas_lotes_codigo, cr_5.datavencimento, cr_5.codigo
  • Sort Method: quicksort Memory: 14462kB
154. 52.486 251.254 ↑ 1.0 177,399 1

WindowAgg (cost=28,163.18..31,267.67 rows=177,399 width=16) (actual time=192.969..251.254 rows=177,399 loops=1)

155. 34.670 198.768 ↑ 1.0 177,399 1

Sort (cost=28,163.18..28,606.68 rows=177,399 width=16) (actual time=192.959..198.768 rows=177,399 loops=1)

  • Sort Key: crav_crav_lotes_1.contasareceber_avulsas_lotes_codigo
  • Sort Method: quicksort Memory: 14460kB
156. 18.919 164.098 ↑ 1.0 177,399 1

Hash Left Join (cost=4,953.67..12,696.97 rows=177,399 width=16) (actual time=53.489..164.098 rows=177,399 loops=1)

  • Hash Cond: (cra_1.codigo = crav_crav_lotes_1.contasareceber_avulsas_codigo)
157. 81.773 145.155 ↑ 1.0 177,399 1

Hash Join (cost=4,951.48..12,029.00 rows=177,399 width=12) (actual time=53.451..145.155 rows=177,399 loops=1)

  • Hash Cond: (cr_5.codigo = cra_1.contasareceber_codigo)
158. 11.317 11.317 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr_5 (cost=0.00..4,532.39 rows=205,639 width=16) (actual time=0.002..11.317 rows=205,641 loops=1)

159. 35.069 52.065 ↑ 1.0 177,399 1

Hash (cost=2,733.99..2,733.99 rows=177,399 width=8) (actual time=52.065..52.065 rows=177,399 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 8978kB
160. 16.996 16.996 ↑ 1.0 177,399 1

Seq Scan on contasareceber_avulsas cra_1 (cost=0.00..2,733.99 rows=177,399 width=8) (actual time=0.006..16.996 rows=177,399 loops=1)

161. 0.017 0.024 ↑ 1.0 53 1

Hash (cost=1.53..1.53 rows=53 width=8) (actual time=0.024..0.024 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
162. 0.007 0.007 ↑ 1.0 53 1

Seq Scan on contasareceber_avulsas_contasareceber_avulsas_lotes crav_crav_lotes_1 (cost=0.00..1.53 rows=53 width=8) (actual time=0.002..0.007 rows=53 loops=1)

163. 0.024 3,483.879 ↑ 2.5 2 1

Hash (cost=34,419.36..34,419.36 rows=5 width=112) (actual time=3,483.879..3,483.879 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
164. 124.762 3,483.855 ↑ 2.5 2 1

Nested Loop Left Join (cost=23,970.50..34,419.36 rows=5 width=112) (actual time=3,483.763..3,483.855 rows=2 loops=1)

  • Filter: (((pvpg_3.codprevenda IS NOT NULL) OR (crav_1.codigo IS NOT NULL) OR (snfpg_1.codsaidasnf IS NOT NULL)) AND (CASE WHEN (crav_1.clientes_codigo IS NOT NULL) THEN crav_1.clientes_codigo WHEN (pv_2.codcliente IS NOT NULL) THEN pv_2.codcliente WHEN (snf_1.codcliente IS NOT NULL) THEN snf_1.codcliente ELSE NULL::integer END = 2))
  • Rows Removed by Filter: 204170
165. 97.016 3,154.921 ↓ 200.2 204,172 1

Hash Join (cost=23,970.08..33,931.61 rows=1,020 width=128) (actual time=2,858.990..3,154.921 rows=204,172 loops=1)

  • Hash Cond: (cr_4.codigo = vcp.contasareceber_faturamentos_cr_codigo)
166. 57.724 353.755 ↓ 1.0 205,448 1

Hash Left Join (cost=14,672.14..23,853.06 rows=205,443 width=28) (actual time=153.307..353.755 rows=205,448 loops=1)

  • Hash Cond: (cr_4.codigo = pvpg_cr_2.contasareceber_codigo)
167. 26.729 211.481 ↓ 1.0 205,448 1

Hash Left Join (cost=6,428.25..14,558.39 rows=205,443 width=20) (actual time=68.612..211.481 rows=205,448 loops=1)

  • Hash Cond: (cr_4.codigo = snfpg_cr_2.contasareceber_codigo)
168. 102.665 181.524 ↓ 1.0 205,448 1

Hash Join (cost=5,733.47..13,091.43 rows=205,443 width=12) (actual time=65.374..181.524 rows=205,448 loops=1)

  • Hash Cond: (cr_4.codigo = cr_fat_1.contasareceber_codigo)
169. 14.710 14.710 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr_4 (cost=0.00..4,532.39 rows=205,639 width=12) (actual time=0.051..14.710 rows=205,641 loops=1)

170. 38.885 64.149 ↓ 1.0 205,448 1

Hash (cost=3,165.43..3,165.43 rows=205,443 width=4) (actual time=64.149..64.149 rows=205,448 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9271kB
171. 25.264 25.264 ↓ 1.0 205,448 1

Seq Scan on contasareceber_faturamentos cr_fat_1 (cost=0.00..3,165.43 rows=205,443 width=4) (actual time=0.005..25.264 rows=205,448 loops=1)

  • Filter: (contasareceber_codigo IS NOT NULL)
172. 0.040 3.228 ↓ 1.0 178 1

Hash (cost=692.58..692.58 rows=176 width=12) (actual time=3.228..3.228 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
173. 0.099 3.188 ↓ 1.0 178 1

Nested Loop Left Join (cost=5.25..692.58 rows=176 width=12) (actual time=2.160..3.188 rows=178 loops=1)

174. 1.852 2.911 ↓ 1.0 178 1

Hash Right Join (cost=4.96..605.16 rows=176 width=8) (actual time=2.148..2.911 rows=178 loops=1)

  • Hash Cond: (snfpg_1.codigo = snfpg_cr_2.saidasnf_pagtos_codigo)
175. 1.011 1.011 ↓ 1.0 22,125 1

Seq Scan on saidasnf_pagto snfpg_1 (cost=0.00..377.22 rows=22,122 width=8) (actual time=0.002..1.011 rows=22,125 loops=1)

176. 0.029 0.048 ↓ 1.0 178 1

Hash (cost=2.76..2.76 rows=176 width=8) (actual time=0.048..0.048 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
177. 0.019 0.019 ↓ 1.0 178 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr_2 (cost=0.00..2.76 rows=176 width=8) (actual time=0.005..0.019 rows=178 loops=1)

178. 0.178 0.178 ↑ 1.0 1 178

Index Scan using saidasnf_codigo_index on saidasnf snf_1 (cost=0.29..0.49 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (snfpg_1.codsaidasnf = codigo)
179. 5.754 84.550 ↑ 1.0 28,064 1

Hash (cost=7,893.09..7,893.09 rows=28,064 width=12) (actual time=84.550..84.550 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1462kB
180. 21.038 78.796 ↑ 1.0 28,064 1

Hash Right Join (cost=3,859.05..7,893.09 rows=28,064 width=12) (actual time=52.441..78.796 rows=28,064 loops=1)

  • Hash Cond: (pv_2.codigo = pvpg_3.codprevenda)
181. 5.486 5.486 ↓ 1.0 91,561 1

Seq Scan on prevendas pv_2 (cost=0.00..3,295.60 rows=91,560 width=8) (actual time=0.001..5.486 rows=91,561 loops=1)

182. 9.015 52.272 ↑ 1.0 28,064 1

Hash (cost=3,508.25..3,508.25 rows=28,064 width=8) (actual time=52.272..52.272 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
183. 14.557 43.257 ↑ 1.0 28,064 1

Hash Left Join (cost=2,716.73..3,508.25 rows=28,064 width=8) (actual time=27.409..43.257 rows=28,064 loops=1)

  • Hash Cond: (pvpg_cr_2.prevendas_pagtos_codigo = pvpg_3.codigo)
184. 1.942 1.942 ↑ 1.0 28,064 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr_2 (cost=0.00..405.64 rows=28,064 width=8) (actual time=0.002..1.942 rows=28,064 loops=1)

185. 17.508 26.758 ↓ 1.0 93,501 1

Hash (cost=1,547.99..1,547.99 rows=93,499 width=8) (actual time=26.758..26.758 rows=93,501 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
186. 9.250 9.250 ↓ 1.0 93,501 1

Seq Scan on prevenda_pagto pvpg_3 (cost=0.00..1,547.99 rows=93,499 width=8) (actual time=0.003..9.250 rows=93,501 loops=1)

187. 68.166 2,704.150 ↓ 200.0 204,172 1

Hash (cost=9,285.18..9,285.18 rows=1,021 width=108) (actual time=2,704.150..2,704.150 rows=204,172 loops=1)

  • Buckets: 262144 (originally 1024) Batches: 1 (originally 1) Memory Usage: 14219kB
188. 47.391 2,635.984 ↓ 200.0 204,172 1

Subquery Scan on vcp (cost=8,684.52..9,285.18 rows=1,021 width=108) (actual time=628.711..2,635.984 rows=204,172 loops=1)

189. 1,958.755 2,588.593 ↓ 200.0 204,172 1

Hash Right Join (cost=8,684.52..9,274.97 rows=1,021 width=36) (actual time=628.710..2,588.593 rows=204,172 loops=1)

  • Hash Cond: (lotpg.contasareceber_pagtos_codigo = crpg.codigo)
190. 1.349 1.349 ↓ 1.0 14,088 1

Seq Scan on contasareceber_pagtos_lote_pagtos lotpg (cost=0.00..217.86 rows=14,086 width=4) (actual time=0.019..1.349 rows=14,088 loops=1)

191. 70.329 628.489 ↓ 200.0 204,172 1

Hash (cost=8,671.76..8,671.76 rows=1,021 width=40) (actual time=628.489..628.489 rows=204,172 loops=1)

  • Buckets: 262144 (originally 1024) Batches: 1 (originally 1) Memory Usage: 18222kB
192. 47.657 558.160 ↓ 200.0 204,172 1

Hash Anti Join (cost=5.76..8,671.76 rows=1,021 width=40) (actual time=0.073..558.160 rows=204,172 loops=1)

  • Hash Cond: (crpg.codigo = crpg_e.contasareceber_pagtos_codigo)
193. 510.448 510.448 ↓ 199.9 204,339 1

Seq Scan on contasareceber_pagtos crpg (cost=0.00..8,653.11 rows=1,022 width=40) (actual time=0.010..510.448 rows=204,339 loops=1)

  • Filter: (((dhpagamento)::date >= ('01/01/0001'::cstring)::date) AND ((dhpagamento)::date <= ('31/12/9999'::cstring)::date))
194. 0.028 0.055 ↑ 1.0 167 1

Hash (cost=3.67..3.67 rows=167 width=8) (actual time=0.055..0.055 rows=167 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
195. 0.027 0.027 ↑ 1.0 167 1

Seq Scan on contasareceber_pagtos_estornos crpg_e (cost=0.00..3.67 rows=167 width=8) (actual time=0.010..0.027 rows=167 loops=1)

196. 204.172 204.172 ↑ 1.0 1 204,172

Index Scan using contasareceber_avulsas_contasareceber_codigo_key on contasareceber_avulsas crav_1 (cost=0.42..0.47 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=204,172)

  • Index Cond: (cr_4.codigo = contasareceber_codigo)
197. 4.787 172.499 ↑ 1.0 28,064 1

Hash (cost=15,942.30..15,942.30 rows=28,064 width=36) (actual time=172.499..172.499 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
198. 3.398 167.712 ↑ 1.0 28,064 1

Subquery Scan on vppc_1 (cost=14,539.10..15,942.30 rows=28,064 width=36) (actual time=138.866..167.712 rows=28,064 loops=1)

199. 24.335 164.314 ↑ 1.0 28,064 1

WindowAgg (cost=14,539.10..15,661.66 rows=28,064 width=16) (actual time=138.864..164.314 rows=28,064 loops=1)

200. 9.712 139.979 ↑ 1.0 28,064 1

Sort (cost=14,539.10..14,609.26 rows=28,064 width=16) (actual time=138.851..139.979 rows=28,064 loops=1)

  • Sort Key: pvpg_cr_3.prevendas_pagtos_codigo, fpf_4.codfinalizadora, cr_6.datavencimento, cr_6.codigo
  • Sort Method: quicksort Memory: 2961kB
201. 17.907 130.267 ↑ 1.0 28,064 1

WindowAgg (cost=11,904.39..12,465.67 rows=28,064 width=16) (actual time=111.217..130.267 rows=28,064 loops=1)

202. 17.348 112.360 ↑ 1.0 28,064 1

Sort (cost=11,904.39..11,974.55 rows=28,064 width=16) (actual time=111.206..112.360 rows=28,064 loops=1)

  • Sort Key: pvpg_cr_3.prevendas_pagtos_codigo, fpf_4.codfinalizadora
  • Sort Method: quicksort Memory: 2084kB
203. 4.615 95.012 ↑ 1.0 28,064 1

Hash Left Join (cost=3,475.02..9,830.96 rows=28,064 width=16) (actual time=34.936..95.012 rows=28,064 loops=1)

  • Hash Cond: (pvpg_4.codformapagtofinalizadora = fpf_4.codigo)
204. 10.053 90.386 ↑ 1.0 28,064 1

Hash Join (cost=3,473.17..9,443.22 rows=28,064 width=16) (actual time=34.908..90.386 rows=28,064 loops=1)

  • Hash Cond: (pvpg_cr_3.prevendas_pagtos_codigo = pvpg_4.codigo)
205. 35.480 51.355 ↑ 1.0 28,064 1

Hash Join (cost=756.44..6,340.62 rows=28,064 width=12) (actual time=5.316..51.355 rows=28,064 loops=1)

  • Hash Cond: (cr_6.codigo = pvpg_cr_3.contasareceber_codigo)
206. 10.655 10.655 ↓ 1.0 205,641 1

Seq Scan on contasareceber cr_6 (cost=0.00..4,532.39 rows=205,639 width=12) (actual time=0.006..10.655 rows=205,641 loops=1)

207. 3.660 5.220 ↑ 1.0 28,064 1

Hash (cost=405.64..405.64 rows=28,064 width=8) (actual time=5.220..5.220 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1353kB
208. 1.560 1.560 ↑ 1.0 28,064 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr_3 (cost=0.00..405.64 rows=28,064 width=8) (actual time=0.003..1.560 rows=28,064 loops=1)

209. 17.544 28.978 ↓ 1.0 93,501 1

Hash (cost=1,547.99..1,547.99 rows=93,499 width=8) (actual time=28.978..28.978 rows=93,501 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
210. 11.434 11.434 ↓ 1.0 93,501 1

Seq Scan on prevenda_pagto pvpg_4 (cost=0.00..1,547.99 rows=93,499 width=8) (actual time=0.003..11.434 rows=93,501 loops=1)

  • Filter: (codprevenda IS NOT NULL)
211. 0.005 0.011 ↑ 1.0 38 1

Hash (cost=1.38..1.38 rows=38 width=8) (actual time=0.011..0.011 rows=38 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
212. 0.006 0.006 ↑ 1.0 38 1

Seq Scan on formapagto_finalizadora fpf_4 (cost=0.00..1.38 rows=38 width=8) (actual time=0.002..0.006 rows=38 loops=1)

213. 0.041 1.532 ↓ 1.0 178 1

Hash (cost=2,254.08..2,254.08 rows=176 width=36) (actual time=1.532..1.532 rows=178 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
214. 0.051 1.491 ↓ 1.0 178 1

Subquery Scan on vspc_1 (cost=2,245.28..2,254.08 rows=176 width=36) (actual time=1.241..1.491 rows=178 loops=1)

215. 0.202 1.440 ↓ 1.0 178 1

WindowAgg (cost=2,245.28..2,252.32 rows=176 width=16) (actual time=1.240..1.440 rows=178 loops=1)

216. 0.043 1.238 ↓ 1.0 178 1

Sort (cost=2,245.28..2,245.72 rows=176 width=16) (actual time=1.234..1.238 rows=178 loops=1)

  • Sort Key: snfpg_cr_3.saidasnf_pagtos_codigo, fpf_5.codfinalizadora, cr_7.datavencimento, cr_7.codigo
  • Sort Method: quicksort Memory: 38kB
217. 0.117 1.195 ↓ 1.0 178 1

WindowAgg (cost=2,235.19..2,238.71 rows=176 width=16) (actual time=1.074..1.195 rows=178 loops=1)

218. 0.054 1.078 ↓ 1.0 178 1

Sort (cost=2,235.19..2,235.63 rows=176 width=16) (actual time=1.069..1.078 rows=178 loops=1)

  • Sort Key: snfpg_cr_3.saidasnf_pagtos_codigo, fpf_5.codfinalizadora
  • Sort Method: quicksort Memory: 33kB
219. 0.000 1.024 ↓ 1.0 178 1

Nested Loop (cost=0.98..2,228.63 rows=176 width=16) (actual time=0.036..1.024 rows=178 loops=1)

220. 0.000 0.702 ↓ 1.0 178 1

Nested Loop Left Join (cost=0.56..857.87 rows=176 width=12) (actual time=0.029..0.702 rows=178 loops=1)

221. 0.019 0.019 ↓ 1.0 178 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr_3 (cost=0.00..2.76 rows=176 width=8) (actual time=0.008..0.019 rows=178 loops=1)

222. 0.178 0.712 ↑ 1.0 1 178

Nested Loop Left Join (cost=0.56..4.85 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=178)

223. 0.178 0.178 ↑ 1.0 1 178

Index Scan using saidasnf_pagto_pkey on saidasnf_pagto spg_2 (cost=0.29..4.30 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (codigo = snfpg_cr_3.saidasnf_pagtos_codigo)
224. 0.000 0.356 ↑ 1.0 1 178

Nested Loop (cost=0.28..0.53 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=178)

225. 0.178 0.178 ↑ 1.0 1 178

Index Scan using formapagto_finalizadora_pkey on formapagto_finalizadora fpf_5 (cost=0.14..0.16 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (codigo = spg_2.codformapagtofinalizadora)
226. 0.178 0.178 ↑ 1.0 1 178

Index Only Scan using tipodocumento_pkey on tipodocumento tdoc_2 (cost=0.14..0.37 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=178)

  • Index Cond: (codigo = fpf_5.codfinalizadora)
  • Heap Fetches: 178
227. 0.356 0.356 ↑ 1.0 1 178

Index Scan using contasareceber_pkey1 on contasareceber cr_7 (cost=0.42..7.78 rows=1 width=12) (actual time=0.001..0.002 rows=1 loops=178)

  • Index Cond: (codigo = snfpg_cr_3.contasareceber_codigo)
228. 0.000 0.000 ↓ 0.0 0 2

Index Scan using gruposcontas_pkey on gruposcontas gc_1 (cost=0.13..0.15 rows=1 width=13) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (cr_4.gruposcontas_codigo = codigo)
229. 0.014 1,306.539 ↓ 6.4 32 1

Subquery Scan on *SELECT* 1_1 (cost=0.00..0.15 rows=5 width=315) (actual time=1,226.397..1,306.539 rows=32 loops=1)

230. 1,306.525 1,306.525 ↓ 6.4 32 1

CTE Scan on contas (cost=0.00..0.10 rows=5 width=315) (actual time=1,226.395..1,306.525 rows=32 loops=1)

231. 4,143.976 4,143.976 ↑ 2.5 2 1

CTE Scan on recebimentos (cost=0.00..0.10 rows=5 width=367) (actual time=4,143.968..4,143.976 rows=2 loops=1)

232. 0.001 0.388 ↑ 1.0 1 1

Subquery Scan on *SELECT* 4 (cost=138.39..138.48 rows=1 width=331) (actual time=0.387..0.388 rows=1 loops=1)

233. 0.003 0.387 ↑ 1.0 1 1

Nested Loop Left Join (cost=138.39..138.47 rows=1 width=331) (actual time=0.386..0.387 rows=1 loops=1)

  • Join Filter: (devs.codigo = prod_devs.coddevolucao)
234.          

CTE devs

235. 0.010 0.329 ↑ 1.0 1 1

HashAggregate (cost=83.16..83.17 rows=1 width=83) (actual time=0.328..0.329 rows=1 loops=1)

  • Group Key: dev.codigo, dev.datadevolucao, dev.valortotal
236. 0.008 0.319 ↑ 1.0 1 1

Nested Loop (cost=28.51..83.14 rows=1 width=83) (actual time=0.316..0.319 rows=1 loops=1)

237. 0.012 0.263 ↓ 2.0 12 1

Nested Loop (cost=28.21..80.89 rows=6 width=87) (actual time=0.205..0.263 rows=12 loops=1)

238. 0.028 0.227 ↓ 2.0 12 1

Nested Loop (cost=27.79..30.21 rows=6 width=87) (actual time=0.192..0.227 rows=12 loops=1)

  • Join Filter: (dev.codigo = dvp.coddevolucao)
  • Rows Removed by Join Filter: 12
239. 0.004 0.193 ↓ 2.0 2 1

Nested Loop Left Join (cost=27.79..28.94 rows=1 width=83) (actual time=0.171..0.193 rows=2 loops=1)

  • Join Filter: (dev.codigo = devpagtos_1.devolucoes_codigo)
  • Rows Removed by Join Filter: 2
240. 0.027 0.027 ↓ 2.0 2 1

Seq Scan on devolucoes dev (cost=0.00..1.06 rows=1 width=19) (actual time=0.012..0.027 rows=2 loops=1)

  • Filter: (((datadevolucao)::date >= ('01/01/0001'::cstring)::date) AND ((datadevolucao)::date <= ('31/12/9999'::cstring)::date))
241. 0.162 0.162 ↑ 1.0 2 2

CTE Scan on devpagtos devpagtos_1 (cost=27.79..27.83 rows=2 width=68) (actual time=0.074..0.081 rows=2 loops=2)

242.          

CTE devpagtos

243. 0.005 0.154 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.79..27.79 rows=2 width=103) (actual time=0.145..0.154 rows=2 loops=1)

  • Join Filter: (devpg_mcx.devolucoes_pagtos_codigo = devpg.codigo)
  • Rows Removed by Join Filter: 1
244. 0.002 0.147 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.79..26.75 rows=2 width=99) (actual time=0.139..0.147 rows=2 loops=1)

245. 0.002 0.145 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.51..25.19 rows=2 width=74) (actual time=0.138..0.145 rows=2 loops=1)

246. 0.002 0.141 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.35..12.83 rows=2 width=70) (actual time=0.134..0.141 rows=2 loops=1)

  • Join Filter: (devpgcc.devolucoes_pagtos_codigo = devpg.codigo)
  • Rows Removed by Join Filter: 1
247. 0.014 0.037 ↑ 1.0 2 1

Hash Right Join (cost=1.04..2.37 rows=2 width=33) (actual time=0.032..0.037 rows=2 loops=1)

  • Hash Cond: (tdoc_3.codigo = devpg.codfinalizadora)
248. 0.004 0.004 ↑ 1.0 22 1

Seq Scan on tipodocumento tdoc_3 (cost=0.00..1.22 rows=22 width=18) (actual time=0.002..0.004 rows=22 loops=1)

249. 0.011 0.019 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=19) (actual time=0.019..0.019 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
250. 0.008 0.008 ↑ 1.0 2 1

Seq Scan on devolucoes_pagtos devpg (cost=0.00..1.02 rows=2 width=19) (actual time=0.007..0.008 rows=2 loops=1)

251. 0.014 0.102 ↑ 1.0 1 2

Materialize (cost=1.31..10.43 rows=1 width=37) (actual time=0.049..0.051 rows=1 loops=2)

252. 0.002 0.088 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.31..10.43 rows=1 width=37) (actual time=0.085..0.088 rows=1 loops=1)

253. 0.051 0.068 ↑ 1.0 1 1

Hash Right Join (cost=1.02..2.12 rows=1 width=12) (actual time=0.064..0.068 rows=1 loops=1)

  • Hash Cond: (clicr.codigo = devpgcc.clientes_creditos_codigo)
254. 0.005 0.005 ↑ 1.0 6 1

Seq Scan on clientes_creditos clicr (cost=0.00..1.06 rows=6 width=8) (actual time=0.004..0.005 rows=6 loops=1)

255. 0.011 0.012 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
256. 0.001 0.001 ↑ 1.0 1 1

Seq Scan on devolucoes_pagtos_clientes_creditos devpgcc (cost=0.00..1.01 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

257. 0.018 0.018 ↑ 1.0 1 1

Index Scan using unq_clientes on clientes c_1 (cost=0.29..8.30 rows=1 width=29) (actual time=0.018..0.018 rows=1 loops=1)

  • Index Cond: (codigo = clicr.clientes_codigo)
258. 0.002 0.002 ↓ 0.0 0 2

Index Scan using devolucoes_pagtos_restituicao_devolucoes_pagtos_codigo_key on devolucoes_pagtos_restituicao devpgrest (cost=0.16..6.17 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (devolucoes_pagtos_codigo = devpg.codigo)
259. 0.000 0.000 ↓ 0.0 0 2

Index Scan using unq_clientes on clientes c (cost=0.29..0.77 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=2)

  • Index Cond: (codigo = devpgrest.clientes_codigo)
260. 0.001 0.002 ↑ 1.0 1 2

Materialize (cost=0.00..1.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=2)

261. 0.001 0.001 ↑ 1.0 1 1

Seq Scan on devolucoes_pagtos_movimentacoescaixa devpg_mcx (cost=0.00..1.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

262. 0.006 0.006 ↑ 1.0 12 2

Seq Scan on devolucoesprod dvp (cost=0.00..1.12 rows=12 width=8) (actual time=0.002..0.003 rows=12 loops=2)

263. 0.024 0.024 ↑ 1.0 1 12

Index Scan using prevendasprod_codigo_index on prevendasprod pvp (cost=0.42..8.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=12)

  • Index Cond: (codigo = dvp.codprevendasprod)
264. 0.048 0.048 ↓ 0.0 0 12

Index Scan using prevendas_codigo_index on prevendas pv_3 (cost=0.29..0.36 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=12)

  • Index Cond: (codigo = pvp.codprevenda)
  • Filter: (codcliente = 2)
  • Rows Removed by Filter: 1
265.          

CTE prod_devs

266. 0.000 0.053 ↑ 2.0 1 1

Unique (cost=55.18..55.21 rows=2 width=42) (actual time=0.053..0.053 rows=1 loops=1)

267. 0.006 0.053 ↑ 6.0 1 1

Sort (cost=55.18..55.20 rows=6 width=42) (actual time=0.053..0.053 rows=1 loops=1)

  • Sort Key: dvp_1.coddevolucao, (sum(dvp_1.valor) OVER (?)) DESC
  • Sort Method: quicksort Memory: 25kB
268. 0.005 0.047 ↑ 6.0 1 1

WindowAgg (cost=54.99..55.11 rows=6 width=42) (actual time=0.046..0.047 rows=1 loops=1)

269. 0.002 0.042 ↑ 6.0 1 1

Sort (cost=54.99..55.00 rows=6 width=42) (actual time=0.042..0.042 rows=1 loops=1)

  • Sort Key: dvp_1.codigo, gp_2.codigo
  • Sort Method: quicksort Memory: 25kB
270. 0.002 0.040 ↑ 6.0 1 1

Nested Loop (cost=0.88..54.91 rows=6 width=42) (actual time=0.038..0.040 rows=1 loops=1)

271. 0.002 0.034 ↑ 6.0 1 1

Nested Loop (cost=0.74..53.88 rows=6 width=19) (actual time=0.033..0.034 rows=1 loops=1)

272. 0.002 0.027 ↑ 6.0 1 1

Nested Loop (cost=0.45..51.94 rows=6 width=19) (actual time=0.026..0.027 rows=1 loops=1)

273. 0.011 0.023 ↑ 6.0 1 1

Hash Semi Join (cost=0.03..1.25 rows=6 width=19) (actual time=0.022..0.023 rows=1 loops=1)

  • Hash Cond: (dvp_1.coddevolucao = devs_1.codigo)
274. 0.001 0.001 ↑ 1.0 12 1

Seq Scan on devolucoesprod dvp_1 (cost=0.00..1.12 rows=12 width=19) (actual time=0.001..0.001 rows=12 loops=1)

275. 0.010 0.011 ↑ 1.0 1 1

Hash (cost=0.02..0.02 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
276. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on devs devs_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

277. 0.002 0.002 ↑ 1.0 1 1

Index Scan using prevendasprod_codigo_index on prevendasprod pvp_1 (cost=0.42..8.44 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (codigo = dvp_1.codprevendasprod)
278. 0.005 0.005 ↑ 1.0 1 1

Index Scan using produtos_codigo_index on produtos prod_2 (cost=0.29..0.31 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (codigo = pvp_1.codproduto)
279. 0.004 0.004 ↑ 1.0 1 1

Index Scan using grupos_pkey on grupos gp_2 (cost=0.14..0.16 rows=1 width=27) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (codigo = prod_2.codgrupo)
280. 0.330 0.330 ↑ 1.0 1 1

CTE Scan on devs (cost=0.00..0.02 rows=1 width=233) (actual time=0.330..0.330 rows=1 loops=1)

281. 0.054 0.054 ↑ 2.0 1 1

CTE Scan on prod_devs (cost=0.00..0.04 rows=2 width=102) (actual time=0.054..0.054 rows=1 loops=1)

282. 0.001 0.087 ↑ 1.0 1 1

Subquery Scan on *SELECT* 5 (cost=27.79..29.05 rows=1 width=318) (actual time=0.086..0.087 rows=1 loops=1)

283. 0.003 0.086 ↑ 1.0 1 1

Nested Loop Left Join (cost=27.79..29.04 rows=1 width=17) (actual time=0.085..0.086 rows=1 loops=1)

  • Join Filter: (cc.codigo = devpagtos.clientes_creditos_codigo)
  • Rows Removed by Join Filter: 2
284. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on clientes_creditos cc (cost=0.00..1.17 rows=1 width=21) (actual time=0.008..0.009 rows=1 loops=1)

  • Filter: ((clientes_codigo = 2) AND (emissao >= ('01/01/0001'::cstring)::date) AND (emissao <= ('31/12/9999'::cstring)::date))
  • Rows Removed by Filter: 5
285. 0.074 0.074 ↑ 1.0 2 1

CTE Scan on devpagtos (cost=27.79..27.83 rows=2 width=4) (actual time=0.060..0.074 rows=2 loops=1)

286.          

CTE devpagtos

287. 0.007 0.071 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.79..27.79 rows=2 width=103) (actual time=0.058..0.071 rows=2 loops=1)

  • Join Filter: (devpg_mcx_1.devolucoes_pagtos_codigo = devpg_1.codigo)
  • Rows Removed by Join Filter: 1
288. 0.003 0.064 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.79..26.75 rows=2 width=99) (actual time=0.053..0.064 rows=2 loops=1)

289. 0.004 0.061 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.51..25.19 rows=2 width=74) (actual time=0.051..0.061 rows=2 loops=1)

290. 0.002 0.057 ↑ 1.0 2 1

Nested Loop Left Join (cost=2.35..12.83 rows=2 width=70) (actual time=0.049..0.057 rows=2 loops=1)

  • Join Filter: (devpgcc_1.devolucoes_pagtos_codigo = devpg_1.codigo)
  • Rows Removed by Join Filter: 1
291. 0.012 0.025 ↑ 1.0 2 1

Hash Right Join (cost=1.04..2.37 rows=2 width=33) (actual time=0.018..0.025 rows=2 loops=1)

  • Hash Cond: (tdoc_4.codigo = devpg_1.codfinalizadora)
292. 0.003 0.003 ↑ 1.0 22 1

Seq Scan on tipodocumento tdoc_4 (cost=0.00..1.22 rows=22 width=18) (actual time=0.001..0.003 rows=22 loops=1)

293. 0.009 0.010 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=19) (actual time=0.010..0.010 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
294. 0.001 0.001 ↑ 1.0 2 1

Seq Scan on devolucoes_pagtos devpg_1 (cost=0.00..1.02 rows=2 width=19) (actual time=0.001..0.001 rows=2 loops=1)

295. 0.004 0.030 ↑ 1.0 1 2

Materialize (cost=1.31..10.43 rows=1 width=37) (actual time=0.013..0.015 rows=1 loops=2)

296. 0.006 0.026 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.31..10.43 rows=1 width=37) (actual time=0.022..0.026 rows=1 loops=1)

297. 0.009 0.020 ↑ 1.0 1 1

Hash Right Join (cost=1.02..2.12 rows=1 width=12) (actual time=0.017..0.020 rows=1 loops=1)

  • Hash Cond: (clicr_1.codigo = devpgcc_1.clientes_creditos_codigo)
298. 0.002 0.002 ↑ 1.0 6 1

Seq Scan on clientes_creditos clicr_1 (cost=0.00..1.06 rows=6 width=8) (actual time=0.001..0.002 rows=6 loops=1)

299. 0.009 0.009 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=1)