explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3HiS

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.073 61,204.944 ↓ 13.3 40 1

Limit (cost=17,395.17..17,395.27 rows=3 width=59) (actual time=61,204.856..61,204.944 rows=40 loops=1)

2. 0.521 61,204.871 ↓ 13.3 40 1

WindowAgg (cost=17,395.17..17,395.27 rows=3 width=59) (actual time=61,204.854..61,204.871 rows=40 loops=1)

3. 1.040 61,204.350 ↓ 339.3 1,018 1

Group (cost=17,395.17..17,395.23 rows=3 width=51) (actual time=61,202.831..61,204.350 rows=1,018 loops=1)

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

Sort (cost=17,395.17..17,395.18 rows=3 width=51) (actual time=61,202.829..61,203.310 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.750 61,198.063 ↓ 676.7 2,030 1

Append (cost=9,196.95..17,395.15 rows=3 width=51) (actual time=30,572.405..61,198.063 rows=2,030 loops=1)

6. 0.564 30,573.314 ↓ 1,014.0 1,014 1

Unique (cost=9,196.95..9,196.97 rows=1 width=51) (actual time=30,572.405..30,573.314 rows=1,014 loops=1)

7. 2.840 30,572.750 ↓ 1,014.0 1,014 1

Sort (cost=9,196.95..9,196.96 rows=1 width=51) (actual time=30,572.403..30,572.750 rows=1,014 loops=1)

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

Nested Loop (cost=3,736.71..9,196.94 rows=1 width=51) (actual time=170.368..30,569.910 rows=1,014 loops=1)

  • Join Filter: (tos."tostclID" = thrfc."thrfctclID")
  • Rows Removed by Join Filter: 2021587
9. 2.354 26,541.652 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,561.15..8,942.90 rows=1 width=55) (actual time=165.308..26,541.652 rows=1,021 loops=1)

10. 3.531 26,498.458 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.87..8,939.95 rows=1 width=21) (actual time=165.244..26,498.458 rows=1,021 loops=1)

11. 883.850 26,487.780 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.59..8,937.95 rows=1 width=25) (actual time=165.224..26,487.780 rows=1,021 loops=1)

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

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

13. 2.777 174.920 ↓ 1,022.0 1,022 1

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

14. 3.693 164.989 ↓ 1,022.0 1,022 1

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

15. 43.573 151.076 ↓ 1,022.0 1,022 1

Hash Right Join (cost=3,559.32..7,390.21 rows=1 width=12) (actual time=147.856..151.076 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.008 32.008 ↑ 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.008 rows=136,578 loops=1)

17. 1.849 75.495 ↓ 5.3 5,163 1

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

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

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

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

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

20. 0.362 4.521 ↓ 5.8 1,022 1

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

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

Seq Scan on "TabSICIColetaMensal" tsc (cost=0.00..652.08 rows=175 width=16) (actual time=3.612..4.159 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. 7.154 7.154 ↑ 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.006..0.007 rows=1 loops=1,022)

  • Index Cond: ("tosID" = tac."tactosID")
24. 7.154 7.154 ↑ 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.006..0.007 rows=1 loops=1,022)

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

Subquery Scan on tlsos (cost=0.29..1,534.43 rows=26 width=4) (actual time=0.019..24.872 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,334.034 20,327.580 ↑ 1.0 16,481 1,022

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

27. 6,993.546 6,993.546 ↑ 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..6.843 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.007..0.007 rows=1 loops=1,021)

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

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

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

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

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

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

32. 666.006 666.713 ↓ 1.0 2,443 1,021

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

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

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

34. 0.567 30,574.455 ↓ 1,015.0 1,015 1

Unique (cost=6,359.43..6,359.45 rows=1 width=51) (actual time=30,573.518..30,574.455 rows=1,015 loops=1)

35. 2.797 30,573.888 ↓ 1,015.0 1,015 1

Sort (cost=6,359.43..6,359.44 rows=1 width=51) (actual time=30,573.516..30,573.888 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. 450.377 30,571.091 ↓ 1,015.0 1,015 1

Nested Loop (cost=2,633.70..6,359.42 rows=1 width=51) (actual time=105.212..30,571.091 rows=1,015 loops=1)

  • Join Filter: (tos_1."tostclID" = thrfc_1."thrfctclID")
  • Rows Removed by Join Filter: 2023567
37. 2.779 26,474.218 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,458.15..6,105.37 rows=1 width=55) (actual time=100.661..26,474.218 rows=1,022 loops=1)

38. 2.856 26,427.493 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.86..6,102.52 rows=1 width=21) (actual time=100.611..26,427.493 rows=1,022 loops=1)

39. 974.111 26,418.505 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.59..6,100.52 rows=1 width=25) (actual time=100.597..26,418.505 rows=1,022 loops=1)

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

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

41. 3.424 114.703 ↓ 1,023.0 1,023 1

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

42. 2.710 105.141 ↓ 1,023.0 1,023 1

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

43. 25.282 92.201 ↓ 1,023.0 1,023 1

Hash Right Join (cost=2,456.32..4,552.83 rows=1 width=12) (actual time=90.185..92.201 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. 19.347 19.347 ↑ 1.0 85,576 1

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

45. 0.745 47.572 ↓ 1.6 1,968 1

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

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

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

  • Hash Cond: (tfls."tflstfcmID" = tfcm."tfcmID")
47. 20.025 20.025 ↑ 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..20.025 rows=85,576 loops=1)

48. 0.335 3.127 ↓ 2.9 1,023 1

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

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

Seq Scan on "TabFUSTColetaMensal" tfcm (cost=0.00..616.32 rows=352 width=16) (actual time=0.043..2.792 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. 6.138 6.138 ↑ 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.005..0.006 rows=1 loops=1,023)

  • Index Cond: ("tosID" = tac_1."tactosID")
52. 6.138 6.138 ↑ 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.005..0.006 rows=1 loops=1,023)

  • Index Cond: ("tclID" = tos_1."tostclID")
53. 4,945.182 25,321.296 ↓ 144.9 3,768 1,023

Subquery Scan on tlsos_1 (cost=0.29..1,534.43 rows=26 width=4) (actual time=0.018..24.752 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,583.394 20,376.114 ↑ 1.0 16,481 1,023

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

55. 6,792.720 6,792.720 ↑ 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.006..6.640 rows=16,481 loops=1,023)

56. 6.132 6.132 ↑ 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.005..0.006 rows=1 loops=1,022)

  • Index Cond: ("tseID" = tac_1."tactseID")
  • Filter: ("tseSistemaAgregado" = 2)
57. 43.946 43.946 ↑ 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.042..0.043 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,018.934 3,646.496 ↓ 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.568 rows=1,981 loops=1,022)

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

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

60. 631.858 632.618 ↓ 1.0 2,443 1,022

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

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

62. 0.004 49.544 ↑ 1.0 1 1

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

63. 0.029 49.540 ↓ 3.0 3 1

Sort (cost=1,838.68..1,838.69 rows=1 width=51) (actual time=49.538..49.540 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.259 49.511 ↓ 3.0 3 1

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

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

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

66. 0.051 36.306 ↓ 3.0 3 1

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

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

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

68. 0.004 36.204 ↑ 1.0 1 1

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

69. 0.024 36.193 ↑ 1.0 1 1

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

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

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

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

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

72. 0.046 0.641 ↑ 1.0 1 1

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

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

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

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

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

75. 0.095 0.162 ↑ 1.7 151 1

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

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

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

77. 0.270 0.270 ↑ 1.0 1 45

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

  • Filter: (("tsgqcmMes" = 3) AND ("tsgqcmAno" = 2019))
  • Rows Removed by Filter: 44
78. 4.737 24.422 ↓ 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.422 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. 12.951 19.685 ↑ 1.0 16,481 1

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

80. 6.734 6.734 ↑ 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.009..6.734 rows=16,481 loops=1)

81. 7.536 7.536 ↑ 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.002..0.002 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.007 0.007 ↑ 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.006..0.007 rows=1 loops=1)

  • Index Cond: ("tclID" = tos_2."tostclID")
84. 0.010 0.010 ↑ 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.008..0.010 rows=1 loops=1)

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

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

86. 0.090 0.090 ↑ 1.0 1 3

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

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

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

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

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

89. 2.814 3.513 ↓ 1.0 2,443 3

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

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

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

Planning time : 11.737 ms
Execution time : 61,205.849 ms