explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9lxI : Optimization for: Optimization for: Optimization for: Optimization for: plan #3HiS; plan #ZCGu; plan #GKJL; plan #Y6VX

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.071 28,936.624 ↓ 13.3 40 1

Limit (cost=17,164.38..17,164.48 rows=3 width=59) (actual time=28,936.541..28,936.624 rows=40 loops=1)

2. 0.265 28,936.553 ↓ 13.3 40 1

WindowAgg (cost=17,164.38..17,164.48 rows=3 width=59) (actual time=28,936.539..28,936.553 rows=40 loops=1)

3. 0.487 28,936.288 ↓ 161.3 484 1

Group (cost=17,164.38..17,164.44 rows=3 width=51) (actual time=28,935.574..28,936.288 rows=484 loops=1)

  • Group Key: tpe."tpeNome", tcl."tclID", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tsc."tscMes", tsc."tscAno", tos."tosAtendimentoSuspenso
4. 2.321 28,935.801 ↓ 321.7 965 1

Sort (cost=17,164.38..17,164.39 rows=3 width=51) (actual time=28,935.573..28,935.801 rows=965 loops=1)

  • Sort Key: tpe."tpeNome", tcl."tclID", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tsc."tscMes", tsc."tscAno", tos."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 160kB
5. 0.342 28,933.480 ↓ 321.7 965 1

Append (cost=9,111.54..17,164.36 rows=3 width=51) (actual time=14,538.501..28,933.480 rows=965 loops=1)

6. 0.295 14,538.960 ↓ 482.0 482 1

Unique (cost=9,111.54..9,111.56 rows=1 width=51) (actual time=14,538.500..14,538.960 rows=482 loops=1)

7. 1.236 14,538.665 ↓ 482.0 482 1

Sort (cost=9,111.54..9,111.54 rows=1 width=51) (actual time=14,538.498..14,538.665 rows=482 loops=1)

  • Sort Key: tcl."tclID", tpe."tpeNome", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tos."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 92kB
8. 219.593 14,537.429 ↓ 482.0 482 1

Nested Loop (cost=3,731.90..9,111.53 rows=1 width=51) (actual time=162.984..14,537.429 rows=482 loops=1)

  • Join Filter: (tos."tostclID" = thrfc."thrfctclID")
  • Rows Removed by Join Filter: 958322
9. 1.347 12,471.860 ↓ 484.0 484 1

Nested Loop (cost=3,556.35..8,857.48 rows=1 width=55) (actual time=160.855..12,471.860 rows=484 loops=1)

10. 1.437 12,453.089 ↓ 484.0 484 1

Nested Loop (cost=3,556.06..8,854.53 rows=1 width=21) (actual time=160.788..12,453.089 rows=484 loops=1)

11. 412.407 12,448.748 ↓ 484.0 484 1

Nested Loop (cost=3,555.79..8,852.54 rows=1 width=25) (actual time=160.770..12,448.748 rows=484 loops=1)

  • Join Filter: (tos."tosID" = tlsos."tlsostosID")
  • Rows Removed by Join Filter: 1823228
12. 1.165 306.117 ↓ 484.0 484 1

Nested Loop (cost=3,555.50..7,379.62 rows=1 width=33) (actual time=160.592..306.117 rows=484 loops=1)

13. 1.475 301.564 ↓ 484.0 484 1

Nested Loop (cost=3,555.22..7,377.46 rows=1 width=25) (actual time=160.575..301.564 rows=484 loops=1)

14. 1.525 296.217 ↓ 484.0 484 1

Nested Loop (cost=3,554.94..7,375.06 rows=1 width=16) (actual time=160.548..296.217 rows=484 loops=1)

15. 35.652 160.624 ↓ 484.0 484 1

Hash Right Join (cost=3,554.52..7,366.61 rows=1 width=12) (actual time=159.615..160.624 rows=484 loops=1)

  • Hash Cond: (tsl2."tsltscID" = tsc."tscID")
  • Join Filter: ((tsl."tslDataHora" < tsl2."tslDataHora") OR ((tsl."tslDataHora" = tsl2."tslDataHora") AND (tsl."tsltscID" < tsl2."tsltscID")))
  • Rows Removed by Join Filter: 797
  • Filter: (tsl2."tslID" IS NULL)
  • Rows Removed by Filter: 258
16. 31.034 31.034 ↑ 1.0 136,578 1

Seq Scan on "TabSICILogAlteracaoSituacao" tsl2 (cost=0.00..2,371.00 rows=136,600 width=16) (actual time=0.007..31.034 rows=136,578 loops=1)

17. 0.246 93.938 ↑ 1.4 539 1

Hash (cost=3,544.83..3,544.83 rows=775 width=28) (actual time=93.937..93.938 rows=539 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
18. 36.127 93.692 ↑ 1.4 539 1

Hash Join (cost=653.83..3,544.83 rows=775 width=28) (actual time=24.415..93.692 rows=539 loops=1)

  • Hash Cond: (tsl."tsltscID" = tsc."tscID")
19. 43.532 43.532 ↑ 1.0 136,578 1

Seq Scan on "TabSICILogAlteracaoSituacao" tsl (cost=0.00..2,371.00 rows=136,600 width=12) (actual time=0.797..43.532 rows=136,578 loops=1)

20. 0.169 14.033 ↓ 3.5 484 1

Hash (cost=652.08..652.08 rows=140 width=16) (actual time=14.032..14.033 rows=484 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
21. 13.864 13.864 ↓ 3.5 484 1

Seq Scan on "TabSICIColetaMensal" tsc (cost=0.00..652.08 rows=140 width=16) (actual time=12.941..13.864 rows=484 loops=1)

  • Filter: (("tscIsExcluido" IS FALSE) AND ("tscMes" = 4) AND ("tscAno" = 2019))
  • Rows Removed by Filter: 24101
22. 134.068 134.068 ↑ 1.0 1 484

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac (cost=0.42..8.44 rows=1 width=12) (actual time=0.276..0.277 rows=1 loops=484)

  • Index Cond: ("tacID" = tsc."tsctacID")
23. 3.872 3.872 ↑ 1.0 1 484

Index Scan using "TabOrdemServico_tosID" on "TabOrdemServico" tos (cost=0.28..2.40 rows=1 width=9) (actual time=0.007..0.008 rows=1 loops=484)

  • Index Cond: ("tosID" = tac."tactosID")
24. 3.388 3.388 ↑ 1.0 1 484

Index Scan using "TabCliente_tclID" on "TabCliente" tcl (cost=0.28..2.15 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=484)

  • Index Cond: ("tclID" = tos."tostclID")
25. 2,310.616 11,730.224 ↓ 139.6 3,768 484

Subquery Scan on tlsos (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.021..24.236 rows=3,768 loops=484)

  • Filter: ((tlsos.r = 1) AND (tlsos."tlsosSituacao" = ANY ('{3,7,9}'::integer[])))
  • Rows Removed by Filter: 12713
26. 6,128.408 9,419.608 ↑ 1.0 16,481 484

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=20) (actual time=0.009..19.462 rows=16,481 loops=484)

27. 3,291.200 3,291.200 ↑ 1.0 16,481 484

Index Scan using idx_tlsos_tlsostosdesc on "TabLogSituacaoOrdemServico" (cost=0.29..915.90 rows=16,494 width=12) (actual time=0.007..6.800 rows=16,481 loops=484)

28. 2.904 2.904 ↑ 1.0 1 484

Index Scan using "TabServico_tseID" on "TabServico" tse (cost=0.28..1.98 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=484)

  • Index Cond: ("tseID" = tac."tactseID")
  • Filter: ("tseSistemaAgregado" = 1)
29. 17.424 17.424 ↑ 1.0 1 484

Index Scan using "TabPessoaID" on "TabPessoa" tpe (cost=0.29..2.94 rows=1 width=42) (actual time=0.035..0.036 rows=1 loops=484)

  • Index Cond: ("tpeID" = tcl."tcltpeID")
  • Filter: ((COALESCE("tpeCNPJCPF", ''::text) ~~* '%%'::text) AND (proc_common_remove_acento("tpeNome") ~~* '%%'::text))
30. 458.832 1,845.976 ↓ 180.1 1,981 484

Subquery Scan on thrfc (cost=175.55..253.91 rows=11 width=4) (actual time=0.008..3.814 rows=1,981 loops=484)

  • Filter: ((thrfc."thrfcIs_Excluido" IS FALSE) AND (thrfc.r = 1))
  • Rows Removed by Filter: 462
31. 1,083.192 1,387.144 ↓ 1.0 2,443 484

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.007..2.866 rows=2,443 loops=484)

32. 303.176 303.952 ↓ 1.0 2,443 484

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.005..0.628 rows=2,443 loops=484)

  • Sort Key: "TabHistoricoRegimeFiscalCliente"."thrfctclID", "TabHistoricoRegimeFiscalCliente"."thrfcID" DESC
  • Sort Method: quicksort Memory: 211kB
33. 0.776 0.776 ↓ 1.0 2,443 1

Seq Scan on "TabHistoricoRegimeFiscalCliente" (cost=0.00..40.11 rows=2,411 width=9) (actual time=0.016..0.776 rows=2,443 loops=1)

34. 0.271 14,223.599 ↓ 482.0 482 1

Unique (cost=6,275.89..6,275.91 rows=1 width=51) (actual time=14,223.165..14,223.599 rows=482 loops=1)

35. 1.215 14,223.328 ↓ 482.0 482 1

Sort (cost=6,275.89..6,275.90 rows=1 width=51) (actual time=14,223.163..14,223.328 rows=482 loops=1)

  • Sort Key: tcl_1."tclID", tpe_1."tpeNome", tpe_1."tpeCNPJCPF", tpe_1."tpeTipoPessoa", tos_1."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 92kB
36. 212.380 14,222.113 ↓ 482.0 482 1

Nested Loop (cost=2,627.18..6,275.88 rows=1 width=51) (actual time=117.764..14,222.113 rows=482 loops=1)

  • Join Filter: (tos_1."tostclID" = thrfc_1."thrfctclID")
  • Rows Removed by Join Filter: 962284
37. 1.309 12,282.003 ↓ 486.0 486 1

Nested Loop (cost=2,451.62..6,021.83 rows=1 width=55) (actual time=115.302..12,282.003 rows=486 loops=1)

38. 1.540 12,263.684 ↓ 486.0 486 1

Nested Loop (cost=2,451.34..6,018.98 rows=1 width=21) (actual time=115.234..12,263.684 rows=486 loops=1)

39. 414.878 12,259.228 ↓ 486.0 486 1

Nested Loop (cost=2,451.06..6,016.98 rows=1 width=25) (actual time=115.219..12,259.228 rows=486 loops=1)

  • Join Filter: (tos_1."tosID" = tlsos_1."tlsostosID")
  • Rows Removed by Join Filter: 1830762
40. 1.307 140.012 ↓ 486.0 486 1

Nested Loop (cost=2,450.77..4,544.07 rows=1 width=33) (actual time=99.363..140.012 rows=486 loops=1)

41. 1.282 135.789 ↓ 486.0 486 1

Nested Loop (cost=2,450.49..4,541.91 rows=1 width=25) (actual time=99.354..135.789 rows=486 loops=1)

42. 1.216 131.105 ↓ 486.0 486 1

Nested Loop (cost=2,450.21..4,539.54 rows=1 width=16) (actual time=99.343..131.105 rows=486 loops=1)

43. 22.699 100.243 ↓ 486.0 486 1

Hash Right Join (cost=2,449.79..4,531.12 rows=1 width=12) (actual time=99.321..100.243 rows=486 loops=1)

  • Hash Cond: (tfls2."tflstfcmID" = tfcm."tfcmID")
  • Join Filter: ((tfls."tflsDataHora" < tfls2."tflsDataHora") OR ((tfls."tflsDataHora" = tfls2."tflsDataHora") AND (tfls."tflstfcmID" < tfls2."tflstfcmID")))
  • Rows Removed by Join Filter: 533
  • Filter: (tfls2."tflsID" IS NULL)
  • Rows Removed by Filter: 34
44. 19.299 19.299 ↑ 1.0 85,576 1

Seq Scan on "TabFUSTLogSituacao" tfls2 (cost=0.00..1,486.80 rows=85,680 width=16) (actual time=0.007..19.299 rows=85,576 loops=1)

45. 0.227 58.245 ↑ 1.9 499 1

Hash (cost=2,437.64..2,437.64 rows=972 width=28) (actual time=58.245..58.245 rows=499 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 40kB
46. 22.802 58.018 ↑ 1.9 499 1

Hash Join (cost=619.82..2,437.64 rows=972 width=28) (actual time=57.030..58.018 rows=499 loops=1)

  • Hash Cond: (tfls."tflstfcmID" = tfcm."tfcmID")
47. 23.908 23.908 ↑ 1.0 85,576 1

Seq Scan on "TabFUSTLogSituacao" tfls (cost=0.00..1,486.80 rows=85,680 width=12) (actual time=0.872..23.908 rows=85,576 loops=1)

48. 0.163 11.308 ↓ 1.7 486 1

Hash (cost=616.32..616.32 rows=280 width=16) (actual time=11.308..11.308 rows=486 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
49. 11.145 11.145 ↓ 1.7 486 1

Seq Scan on "TabFUSTColetaMensal" tfcm (cost=0.00..616.32 rows=280 width=16) (actual time=0.883..11.145 rows=486 loops=1)

  • Filter: (("tfcmMes" = 4) AND ("tfcmAno" = 2019))
  • Rows Removed by Filter: 24108
50. 29.646 29.646 ↑ 1.0 1 486

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac_1 (cost=0.42..8.41 rows=1 width=12) (actual time=0.060..0.061 rows=1 loops=486)

  • Index Cond: ("tacID" = tfcm."tfcmtacID")
51. 3.402 3.402 ↑ 1.0 1 486

Index Scan using "TabOrdemServico_tosID" on "TabOrdemServico" tos_1 (cost=0.28..2.36 rows=1 width=9) (actual time=0.006..0.007 rows=1 loops=486)

  • Index Cond: ("tosID" = tac_1."tactosID")
52. 2.916 2.916 ↑ 1.0 1 486

Index Scan using "TabCliente_tclID" on "TabCliente" tcl_1 (cost=0.28..2.15 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=486)

  • Index Cond: ("tclID" = tos_1."tostclID")
53. 2,311.416 11,704.338 ↓ 139.6 3,768 486

Subquery Scan on tlsos_1 (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.019..24.083 rows=3,768 loops=486)

  • Filter: ((tlsos_1.r = 1) AND (tlsos_1."tlsosSituacao" = ANY ('{3,7,9}'::integer[])))
  • Rows Removed by Filter: 12713
54. 6,057.990 9,392.922 ↑ 1.0 16,481 486

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=20) (actual time=0.008..19.327 rows=16,481 loops=486)

55. 3,334.932 3,334.932 ↑ 1.0 16,481 486

Index Scan using idx_tlsos_tlsostosdesc on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_1" (cost=0.29..915.90 rows=16,494 width=12) (actual time=0.007..6.862 rows=16,481 loops=486)

56. 2.916 2.916 ↑ 1.0 1 486

Index Scan using "TabServico_tseID" on "TabServico" tse_1 (cost=0.28..1.98 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=486)

  • Index Cond: ("tseID" = tac_1."tactseID")
  • Filter: ("tseSistemaAgregado" = 2)
57. 17.010 17.010 ↑ 1.0 1 486

Index Scan using "TabPessoaID" on "TabPessoa" tpe_1 (cost=0.29..2.85 rows=1 width=42) (actual time=0.034..0.035 rows=1 loops=486)

  • Index Cond: ("tpeID" = tcl_1."tcltpeID")
  • Filter: ((COALESCE("tpeCNPJCPF", ''::text) ~~* '%%'::text) AND (proc_common_remove_acento("tpeNome") ~~* '%%'::text))
58. 473.364 1,727.730 ↓ 180.1 1,981 486

Subquery Scan on thrfc_1 (cost=175.55..253.91 rows=11 width=4) (actual time=0.008..3.555 rows=1,981 loops=486)

  • Filter: ((thrfc_1."thrfcIs_Excluido" IS FALSE) AND (thrfc_1.r = 1))
  • Rows Removed by Filter: 462
59. 952.074 1,254.366 ↓ 1.0 2,443 486

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.007..2.581 rows=2,443 loops=486)

60. 301.604 302.292 ↓ 1.0 2,443 486

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.005..0.622 rows=2,443 loops=486)

  • Sort Key: "TabHistoricoRegimeFiscalCliente_1"."thrfctclID", "TabHistoricoRegimeFiscalCliente_1"."thrfcID" DESC
  • Sort Method: quicksort Memory: 211kB
61. 0.688 0.688 ↓ 1.0 2,443 1

Seq Scan on "TabHistoricoRegimeFiscalCliente" "TabHistoricoRegimeFiscalCliente_1" (cost=0.00..40.11 rows=2,411 width=9) (actual time=0.010..0.688 rows=2,443 loops=1)

62. 0.004 170.579 ↑ 1.0 1 1

Unique (cost=1,776.84..1,776.86 rows=1 width=51) (actual time=170.574..170.579 rows=1 loops=1)

63. 0.031 170.575 ↓ 6.0 6 1

Sort (cost=1,776.84..1,776.85 rows=1 width=51) (actual time=170.574..170.575 rows=6 loops=1)

  • Sort Key: tcl_2."tclID", tpe_2."tpeNome", tpe_2."tpeCNPJCPF", tpe_2."tpeTipoPessoa", tos_2."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 25kB
64. 8.043 170.544 ↓ 6.0 6 1

Nested Loop (cost=192.19..1,776.83 rows=1 width=51) (actual time=83.175..170.544 rows=6 loops=1)

  • Join Filter: (tos_2."tostclID" = thrfc_2."thrfctclID")
  • Rows Removed by Join Filter: 29709
65. 0.029 108.816 ↓ 15.0 15 1

Nested Loop (cost=16.63..1,522.78 rows=1 width=55) (actual time=35.638..108.816 rows=15 loops=1)

66. 0.155 108.442 ↓ 15.0 15 1

Nested Loop (cost=16.35..1,520.04 rows=1 width=21) (actual time=35.582..108.442 rows=15 loops=1)

  • Join Filter: (tsgqcm."tsgqcmID" = tsgql."tsgqltsgqcmID")
  • Rows Removed by Join Filter: 438
67. 0.012 108.161 ↓ 3.0 3 1

Nested Loop (cost=16.35..1,512.28 rows=1 width=29) (actual time=35.495..108.161 rows=3 loops=1)

68. 0.014 108.125 ↓ 3.0 3 1

Nested Loop (cost=16.07..1,510.28 rows=1 width=33) (actual time=35.482..108.125 rows=3 loops=1)

69. 0.034 108.090 ↓ 3.0 3 1

Nested Loop (cost=15.79..1,508.27 rows=1 width=25) (actual time=35.472..108.090 rows=3 loops=1)

  • Join Filter: (tlsos_2."tlsostosID" = tos_2."tosID")
70. 6.189 108.026 ↓ 3.0 3 1

Nested Loop (cost=15.51..1,506.09 rows=1 width=28) (actual time=35.430..108.026 rows=3 loops=1)

  • Join Filter: (tlsos_2."tlsostosID" = tac_2."tactosID")
  • Rows Removed by Join Filter: 11301
71. 4.985 79.229 ↓ 11,304.0 11,304 1

Nested Loop (cost=15.09..1,497.64 rows=1 width=24) (actual time=1.052..79.229 rows=11,304 loops=1)

72. 0.093 1.122 ↓ 3.0 3 1

Nested Loop (cost=14.80..24.79 rows=1 width=20) (actual time=1.019..1.122 rows=3 loops=1)

  • Join Filter: (tsgqcm."tsgqcmID" = tsgqll."tsgqltsgqcmID")
  • Rows Removed by Join Filter: 132
73. 0.042 0.804 ↓ 45.0 45 1

Subquery Scan on tsgqll (cost=14.80..23.12 rows=1 width=4) (actual time=0.599..0.804 rows=45 loops=1)

  • Filter: (tsgqll.s = 1)
  • Rows Removed by Filter: 106
74. 0.133 0.762 ↑ 1.7 151 1

WindowAgg (cost=14.80..19.92 rows=256 width=36) (actual time=0.590..0.762 rows=151 loops=1)

75. 0.107 0.629 ↑ 1.7 151 1

Sort (cost=14.80..15.44 rows=256 width=8) (actual time=0.585..0.629 rows=151 loops=1)

  • Sort Key: "TabSGQLogSituacao"."tsgqltsgqcmID", "TabSGQLogSituacao"."tsgqlID" DESC
  • Sort Method: quicksort Memory: 32kB
76. 0.522 0.522 ↑ 1.7 151 1

Seq Scan on "TabSGQLogSituacao" (cost=0.00..4.56 rows=256 width=8) (actual time=0.474..0.522 rows=151 loops=1)

77. 0.225 0.225 ↓ 3.0 3 45

Seq Scan on "TabSGQColetaMensal" tsgqcm (cost=0.00..1.66 rows=1 width=16) (actual time=0.004..0.005 rows=3 loops=45)

  • Filter: (("tsgqcmMes" = 4) AND ("tsgqcmAno" = 2019))
  • Rows Removed by Filter: 42
78. 14.526 73.122 ↓ 139.6 3,768 3

Subquery Scan on tlsos_2 (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.024..24.374 rows=3,768 loops=3)

  • Filter: ((tlsos_2.r = 1) AND (tlsos_2."tlsosSituacao" = ANY ('{3,7,9}'::integer[])))
  • Rows Removed by Filter: 12713
79. 37.935 58.596 ↑ 1.0 16,481 3

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=20) (actual time=0.010..19.532 rows=16,481 loops=3)

80. 20.661 20.661 ↑ 1.0 16,481 3

Index Scan using idx_tlsos_tlsostosdesc on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_2" (cost=0.29..915.90 rows=16,494 width=12) (actual time=0.008..6.887 rows=16,481 loops=3)

81. 22.608 22.608 ↑ 1.0 1 11,304

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac_2 (cost=0.42..8.44 rows=1 width=12) (actual time=0.001..0.002 rows=1 loops=11,304)

  • Index Cond: ("tacID" = tsgqcm."tsgqcmtacID")
82. 0.030 0.030 ↑ 1.0 1 3

Index Scan using "TabOrdemServico_tosID" on "TabOrdemServico" tos_2 (cost=0.28..2.17 rows=1 width=9) (actual time=0.009..0.010 rows=1 loops=3)

  • Index Cond: ("tosID" = tac_2."tactosID")
83. 0.021 0.021 ↑ 1.0 1 3

Index Scan using "TabCliente_tclID" on "TabCliente" tcl_2 (cost=0.28..2.00 rows=1 width=8) (actual time=0.005..0.007 rows=1 loops=3)

  • Index Cond: ("tclID" = tos_2."tostclID")
84. 0.024 0.024 ↑ 1.0 1 3

Index Scan using "TabServico_tseID" on "TabServico" tse_2 (cost=0.28..1.98 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=3)

  • Index Cond: ("tseID" = tac_2."tactseID")
  • Filter: ("tseSistemaAgregado" = 3)
85. 0.126 0.126 ↑ 1.7 151 3

Seq Scan on "TabSGQLogSituacao" tsgql (cost=0.00..4.56 rows=256 width=4) (actual time=0.011..0.042 rows=151 loops=3)

86. 0.345 0.345 ↑ 1.0 1 15

Index Scan using "TabPessoaID" on "TabPessoa" tpe_2 (cost=0.29..2.73 rows=1 width=42) (actual time=0.022..0.023 rows=1 loops=15)

  • Index Cond: ("tpeID" = tcl_2."tcltpeID")
  • Filter: ((COALESCE("tpeCNPJCPF", ''::text) ~~* '%%'::text) AND (proc_common_remove_acento("tpeNome") ~~* '%%'::text))
87. 14.670 53.685 ↓ 180.1 1,981 15

Subquery Scan on thrfc_2 (cost=175.55..253.91 rows=11 width=4) (actual time=0.131..3.579 rows=1,981 loops=15)

  • Filter: ((thrfc_2."thrfcIs_Excluido" IS FALSE) AND (thrfc_2.r = 1))
  • Rows Removed by Filter: 462
88. 28.320 39.015 ↓ 1.0 2,443 15

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.130..2.601 rows=2,443 loops=15)

89. 9.908 10.695 ↓ 1.0 2,443 15

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.128..0.713 rows=2,443 loops=15)

  • Sort Key: "TabHistoricoRegimeFiscalCliente_2"."thrfctclID", "TabHistoricoRegimeFiscalCliente_2"."thrfcID" DESC
  • Sort Method: quicksort Memory: 211kB
90. 0.787 0.787 ↓ 1.0 2,443 1

Seq Scan on "TabHistoricoRegimeFiscalCliente" "TabHistoricoRegimeFiscalCliente_2" (cost=0.00..40.11 rows=2,411 width=9) (actual time=0.009..0.787 rows=2,443 loops=1)

Planning time : 17.776 ms
Execution time : 28,937.458 ms