explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZCGu : Optimization for: plan #3HiS

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.098 64,006.966 ↓ 13.3 40 1

Limit (cost=17,395.17..17,395.27 rows=3 width=59) (actual time=64,006.855..64,006.966 rows=40 loops=1)

2. 0.502 64,006.868 ↓ 13.3 40 1

WindowAgg (cost=17,395.17..17,395.27 rows=3 width=59) (actual time=64,006.853..64,006.868 rows=40 loops=1)

3. 1.098 64,006.366 ↓ 339.3 1,018 1

Group (cost=17,395.17..17,395.23 rows=3 width=51) (actual time=64,004.769..64,006.366 rows=1,018 loops=1)

  • Group Key: tpe."tpeNome", tcl."tclID", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tsc."tscMes", tsc."tscAno", tos."tosAtendimentoSuspenso
4. 5.208 64,005.268 ↓ 676.7 2,030 1

Sort (cost=17,395.17..17,395.18 rows=3 width=51) (actual time=64,004.768..64,005.268 rows=2,030 loops=1)

  • Sort Key: tpe."tpeNome", tcl."tclID", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tsc."tscMes", tsc."tscAno", tos."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 334kB
5. 0.735 64,000.060 ↓ 676.7 2,030 1

Append (cost=9,196.95..17,395.15 rows=3 width=51) (actual time=31,790.881..64,000.060 rows=2,030 loops=1)

6. 0.544 31,791.775 ↓ 1,014.0 1,014 1

Unique (cost=9,196.95..9,196.97 rows=1 width=51) (actual time=31,790.880..31,791.775 rows=1,014 loops=1)

7. 3.305 31,791.231 ↓ 1,014.0 1,014 1

Sort (cost=9,196.95..9,196.96 rows=1 width=51) (actual time=31,790.879..31,791.231 rows=1,014 loops=1)

  • Sort Key: tcl."tclID", tpe."tpeNome", tpe."tpeCNPJCPF", tpe."tpeTipoPessoa", tos."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 167kB
8. 505.886 31,787.926 ↓ 1,014.0 1,014 1

Nested Loop (cost=3,736.71..9,196.94 rows=1 width=51) (actual time=216.039..31,787.926 rows=1,014 loops=1)

  • Join Filter: (tos."tostclID" = thrfc."thrfctclID")
  • Rows Removed by Join Filter: 2021587
9. 2.151 27,521.697 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,561.15..8,942.90 rows=1 width=55) (actual time=210.795..27,521.697 rows=1,021 loops=1)

10. 6.709 27,484.832 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.87..8,939.95 rows=1 width=21) (actual time=210.720..27,484.832 rows=1,021 loops=1)

11. 910.581 27,470.976 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.59..8,937.95 rows=1 width=25) (actual time=210.136..27,470.976 rows=1,021 loops=1)

  • Join Filter: (tos."tosID" = tlsos."tlsostosID")
  • Rows Removed by Join Filter: 3849875
12. 2.566 225.499 ↓ 1,022.0 1,022 1

Nested Loop (cost=3,560.30..7,403.20 rows=1 width=33) (actual time=192.086..225.499 rows=1,022 loops=1)

13. 3.067 216.801 ↓ 1,022.0 1,022 1

Nested Loop (cost=3,560.02..7,401.04 rows=1 width=25) (actual time=192.076..216.801 rows=1,022 loops=1)

14. 2.715 207.602 ↓ 1,022.0 1,022 1

Nested Loop (cost=3,559.74..7,398.63 rows=1 width=16) (actual time=192.065..207.602 rows=1,022 loops=1)

15. 42.895 194.667 ↓ 1,022.0 1,022 1

Hash Right Join (cost=3,559.32..7,390.21 rows=1 width=12) (actual time=192.006..194.667 rows=1,022 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: 17445
  • Filter: (tsl2."tslID" IS NULL)
  • Rows Removed by Filter: 12282
16. 32.200 32.200 ↑ 1.0 136,578 1

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

17. 2.014 119.572 ↓ 5.3 5,163 1

Hash (cost=3,547.21..3,547.21 rows=969 width=28) (actual time=119.570..119.572 rows=5,163 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 387kB
18. 38.182 117.558 ↓ 5.3 5,163 1

Hash Join (cost=654.27..3,547.21 rows=969 width=28) (actual time=40.703..117.558 rows=5,163 loops=1)

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

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

20. 0.341 40.120 ↓ 5.8 1,022 1

Hash (cost=652.08..652.08 rows=175 width=16) (actual time=40.119..40.120 rows=1,022 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
21. 39.779 39.779 ↓ 5.8 1,022 1

Seq Scan on "TabSICIColetaMensal" tsc (cost=0.00..652.08 rows=175 width=16) (actual time=39.118..39.779 rows=1,022 loops=1)

  • Filter: (("tscIsExcluido" IS FALSE) AND ("tscMes" = 3) AND ("tscAno" = 2019))
  • Rows Removed by Filter: 23563
22. 10.220 10.220 ↑ 1.0 1 1,022

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac (cost=0.42..8.41 rows=1 width=12) (actual time=0.009..0.010 rows=1 loops=1,022)

  • Index Cond: ("tacID" = tsc."tsctacID")
23. 6.132 6.132 ↑ 1.0 1 1,022

Index Scan using "TabOrdemServico_tosID" on "TabOrdemServico" tos (cost=0.28..2.40 rows=1 width=9) (actual time=0.005..0.006 rows=1 loops=1,022)

  • Index Cond: ("tosID" = tac."tactosID")
24. 6.132 6.132 ↑ 1.0 1 1,022

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

  • Index Cond: ("tclID" = tos."tostclID")
25. 5,209.134 26,334.896 ↓ 144.9 3,768 1,022

Subquery Scan on tlsos (cost=0.29..1,534.43 rows=26 width=4) (actual time=0.017..25.768 rows=3,768 loops=1,022)

  • Filter: ((tlsos.r = 1) AND ((tlsos."tlsosSituacao" = 3) OR (tlsos."tlsosSituacao" = 9) OR (tlsos."tlsosSituacao" = 7)))
  • Rows Removed by Filter: 12713
26. 13,855.254 21,125.762 ↑ 1.0 16,481 1,022

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=68) (actual time=0.007..20.671 rows=16,481 loops=1,022)

27. 7,270.508 7,270.508 ↑ 1.0 16,481 1,022

Index Scan using idx_tlsos_tlsostosdesc on "TabLogSituacaoOrdemServico" (cost=0.29..915.90 rows=16,494 width=12) (actual time=0.006..7.114 rows=16,481 loops=1,022)

28. 7.147 7.147 ↑ 1.0 1 1,021

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

  • Index Cond: ("tseID" = tac."tactseID")
  • Filter: ("tseSistemaAgregado" = 1)
29. 34.714 34.714 ↑ 1.0 1 1,021

Index Scan using "TabPessoaID" on "TabPessoa" tpe (cost=0.29..2.94 rows=1 width=42) (actual time=0.032..0.034 rows=1 loops=1,021)

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

Subquery Scan on thrfc (cost=175.55..253.91 rows=11 width=4) (actual time=0.006..3.683 rows=1,981 loops=1,021)

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

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.005..2.646 rows=2,443 loops=1,021)

32. 680.174 681.007 ↓ 1.0 2,443 1,021

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.003..0.667 rows=2,443 loops=1,021)

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

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

34. 0.556 32,148.848 ↓ 1,015.0 1,015 1

Unique (cost=6,359.43..6,359.45 rows=1 width=51) (actual time=32,147.943..32,148.848 rows=1,015 loops=1)

35. 3.240 32,148.292 ↓ 1,015.0 1,015 1

Sort (cost=6,359.43..6,359.44 rows=1 width=51) (actual time=32,147.941..32,148.292 rows=1,015 loops=1)

  • Sort Key: tcl_1."tclID", tpe_1."tpeNome", tpe_1."tpeCNPJCPF", tpe_1."tpeTipoPessoa", tos_1."tosAtendimentoSuspenso
  • Sort Method: quicksort Memory: 167kB
36. 469.756 32,145.052 ↓ 1,015.0 1,015 1

Nested Loop (cost=2,633.70..6,359.42 rows=1 width=51) (actual time=116.420..32,145.052 rows=1,015 loops=1)

  • Join Filter: (tos_1."tostclID" = thrfc_1."thrfctclID")
  • Rows Removed by Join Filter: 2023567
37. 2.885 27,916.380 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,458.15..6,105.37 rows=1 width=55) (actual time=111.935..27,916.380 rows=1,022 loops=1)

38. 3.596 27,867.505 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.86..6,102.52 rows=1 width=21) (actual time=111.874..27,867.505 rows=1,022 loops=1)

39. 929.982 27,855.733 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.59..6,100.52 rows=1 width=25) (actual time=111.837..27,855.733 rows=1,022 loops=1)

  • Join Filter: (tos_1."tosID" = tlsos_1."tlsostosID")
  • Rows Removed by Join Filter: 3853642
40. 2.627 138.496 ↓ 1,023.0 1,023 1

Nested Loop (cost=2,457.30..4,565.77 rows=1 width=33) (actual time=101.367..138.496 rows=1,023 loops=1)

41. 3.462 128.708 ↓ 1,023.0 1,023 1

Nested Loop (cost=2,457.02..4,563.61 rows=1 width=25) (actual time=101.356..128.708 rows=1,023 loops=1)

42. 4.017 118.085 ↓ 1,023.0 1,023 1

Nested Loop (cost=2,456.74..4,561.23 rows=1 width=16) (actual time=101.346..118.085 rows=1,023 loops=1)

43. 26.149 103.838 ↓ 1,023.0 1,023 1

Hash Right Join (cost=2,456.32..4,552.83 rows=1 width=12) (actual time=101.320..103.838 rows=1,023 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: 3411
  • Filter: (tfls2."tflsID" IS NULL)
  • Rows Removed by Filter: 1443
44. 23.901 23.901 ↑ 1.0 85,576 1

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

45. 0.771 53.788 ↓ 1.6 1,968 1

Hash (cost=2,441.04..2,441.04 rows=1,222 width=28) (actual time=53.788..53.788 rows=1,968 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 139kB
46. 25.615 53.017 ↓ 1.6 1,968 1

Hash Join (cost=620.72..2,441.04 rows=1,222 width=28) (actual time=3.429..53.017 rows=1,968 loops=1)

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

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

48. 0.308 3.191 ↓ 2.9 1,023 1

Hash (cost=616.32..616.32 rows=352 width=16) (actual time=3.191..3.191 rows=1,023 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
49. 2.883 2.883 ↓ 2.9 1,023 1

Seq Scan on "TabFUSTColetaMensal" tfcm (cost=0.00..616.32 rows=352 width=16) (actual time=0.053..2.883 rows=1,023 loops=1)

  • Filter: (("tfcmMes" = 3) AND ("tfcmAno" = 2019))
  • Rows Removed by Filter: 23571
50. 10.230 10.230 ↑ 1.0 1 1,023

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac_1 (cost=0.42..8.39 rows=1 width=12) (actual time=0.009..0.010 rows=1 loops=1,023)

  • Index Cond: ("tacID" = tfcm."tfcmtacID")
51. 7.161 7.161 ↑ 1.0 1 1,023

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=1,023)

  • Index Cond: ("tosID" = tac_1."tactosID")
52. 7.161 7.161 ↑ 1.0 1 1,023

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

  • Index Cond: ("tclID" = tos_1."tostclID")
53. 5,397.348 26,787.255 ↓ 144.9 3,768 1,023

Subquery Scan on tlsos_1 (cost=0.29..1,534.43 rows=26 width=4) (actual time=0.023..26.185 rows=3,768 loops=1,023)

  • Filter: ((tlsos_1.r = 1) AND ((tlsos_1."tlsosSituacao" = 3) OR (tlsos_1."tlsosSituacao" = 9) OR (tlsos_1."tlsosSituacao" = 7)))
  • Rows Removed by Filter: 12713
54. 13,896.432 21,389.907 ↑ 1.0 16,481 1,023

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=68) (actual time=0.012..20.909 rows=16,481 loops=1,023)

55. 7,493.475 7,493.475 ↑ 1.0 16,481 1,023

Index Scan using idx_tlsos_tlsostosdesc on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_1" (cost=0.29..915.90 rows=16,494 width=12) (actual time=0.011..7.325 rows=16,481 loops=1,023)

56. 8.176 8.176 ↑ 1.0 1 1,022

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

  • Index Cond: ("tseID" = tac_1."tactseID")
  • Filter: ("tseSistemaAgregado" = 2)
57. 45.990 45.990 ↑ 1.0 1 1,022

Index Scan using "TabPessoaID" on "TabPessoa" tpe_1 (cost=0.29..2.85 rows=1 width=42) (actual time=0.043..0.045 rows=1 loops=1,022)

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

Subquery Scan on thrfc_1 (cost=175.55..253.91 rows=11 width=4) (actual time=0.006..3.678 rows=1,981 loops=1,022)

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

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.005..2.657 rows=2,443 loops=1,022)

60. 654.456 655.102 ↓ 1.0 2,443 1,022

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.003..0.641 rows=2,443 loops=1,022)

  • Sort Key: "TabHistoricoRegimeFiscalCliente_1"."thrfctclID", "TabHistoricoRegimeFiscalCliente_1"."thrfcID" DESC
  • Sort Method: quicksort Memory: 211kB
61. 0.646 0.646 ↓ 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.646 rows=2,443 loops=1)

62. 0.002 58.702 ↑ 1.0 1 1

Unique (cost=1,838.68..1,838.70 rows=1 width=51) (actual time=58.699..58.702 rows=1 loops=1)

63. 0.028 58.700 ↓ 3.0 3 1

Sort (cost=1,838.68..1,838.69 rows=1 width=51) (actual time=58.698..58.700 rows=3 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. 1.282 58.672 ↓ 3.0 3 1

Nested Loop (cost=192.19..1,838.67 rows=1 width=51) (actual time=31.955..58.672 rows=3 loops=1)

  • Join Filter: (tos_2."tostclID" = thrfc_2."thrfctclID")
  • Rows Removed by Join Filter: 5940
65. 0.007 41.181 ↓ 3.0 3 1

Nested Loop (cost=16.63..1,584.63 rows=1 width=55) (actual time=23.032..41.181 rows=3 loops=1)

66. 0.047 41.060 ↓ 3.0 3 1

Nested Loop (cost=16.35..1,581.88 rows=1 width=21) (actual time=22.982..41.060 rows=3 loops=1)

  • Join Filter: (tsgqcm."tsgqcmID" = tsgql."tsgqltsgqcmID")
  • Rows Removed by Join Filter: 148
67. 0.006 40.968 ↑ 1.0 1 1

Nested Loop (cost=16.35..1,574.12 rows=1 width=29) (actual time=22.914..40.968 rows=1 loops=1)

68. 0.002 40.951 ↑ 1.0 1 1

Nested Loop (cost=16.07..1,572.13 rows=1 width=33) (actual time=22.901..40.951 rows=1 loops=1)

69. 0.017 40.939 ↑ 1.0 1 1

Nested Loop (cost=15.79..1,570.11 rows=1 width=25) (actual time=22.889..40.939 rows=1 loops=1)

  • Join Filter: (tlsos_2."tlsostosID" = tos_2."tosID")
70. 2.539 40.915 ↑ 1.0 1 1

Nested Loop (cost=15.51..1,567.93 rows=1 width=28) (actual time=22.871..40.915 rows=1 loops=1)

  • Join Filter: (tlsos_2."tlsostosID" = tac_2."tactosID")
  • Rows Removed by Join Filter: 3767
71. 1.712 27.072 ↓ 3,768.0 3,768 1

Nested Loop (cost=15.09..1,559.48 rows=1 width=24) (actual time=0.555..27.072 rows=3,768 loops=1)

72. 0.044 0.614 ↑ 1.0 1 1

Nested Loop (cost=14.80..24.79 rows=1 width=20) (actual time=0.521..0.614 rows=1 loops=1)

  • Join Filter: (tsgqcm."tsgqcmID" = tsgqll."tsgqltsgqcmID")
  • Rows Removed by Join Filter: 44
73. 0.046 0.345 ↓ 45.0 45 1

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

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

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

75. 0.118 0.189 ↑ 1.7 151 1

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

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

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

77. 0.225 0.225 ↑ 1.0 1 45

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

  • Filter: (("tsgqcmMes" = 3) AND ("tsgqcmAno" = 2019))
  • Rows Removed by Filter: 44
78. 4.889 24.746 ↓ 144.9 3,768 1

Subquery Scan on tlsos_2 (cost=0.29..1,534.43 rows=26 width=4) (actual time=0.030..24.746 rows=3,768 loops=1)

  • Filter: ((tlsos_2.r = 1) AND ((tlsos_2."tlsosSituacao" = 3) OR (tlsos_2."tlsosSituacao" = 9) OR (tlsos_2."tlsosSituacao" = 7)))
  • Rows Removed by Filter: 12713
79. 13.006 19.857 ↑ 1.0 16,481 1

WindowAgg (cost=0.29..1,204.55 rows=16,494 width=68) (actual time=0.012..19.857 rows=16,481 loops=1)

80. 6.851 6.851 ↑ 1.0 16,481 1

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

81. 11.304 11.304 ↑ 1.0 1 3,768

Index Scan using "TabAssessoriaCliente_tacID" on "TabAssessoriaCliente" tac_2 (cost=0.42..8.44 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=3,768)

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

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

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

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

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

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

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

Seq Scan on "TabSGQLogSituacao" tsgql (cost=0.00..4.56 rows=256 width=4) (actual time=0.006..0.045 rows=151 loops=1)

86. 0.114 0.114 ↑ 1.0 1 3

Index Scan using "TabPessoaID" on "TabPessoa" tpe_2 (cost=0.29..2.73 rows=1 width=42) (actual time=0.036..0.038 rows=1 loops=3)

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

Subquery Scan on thrfc_2 (cost=175.55..253.91 rows=11 width=4) (actual time=0.610..5.403 rows=1,981 loops=3)

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

WindowAgg (cost=175.55..223.77 rows=2,411 width=33) (actual time=0.608..3.083 rows=2,443 loops=3)

89. 2.755 3.507 ↓ 1.0 2,443 3

Sort (cost=175.55..181.58 rows=2,411 width=9) (actual time=0.605..1.169 rows=2,443 loops=3)

  • Sort Key: "TabHistoricoRegimeFiscalCliente_2"."thrfctclID", "TabHistoricoRegimeFiscalCliente_2"."thrfcID" DESC
  • Sort Method: quicksort Memory: 211kB
90. 0.752 0.752 ↓ 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.752 rows=2,443 loops=1)

Planning time : 40.356 ms
Execution time : 64,007.958 ms