explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.076 60,297.875 ↓ 13.3 40 1

Limit (cost=17,209.65..17,209.75 rows=3 width=59) (actual time=60,297.786..60,297.875 rows=40 loops=1)

2. 0.533 60,297.799 ↓ 13.3 40 1

WindowAgg (cost=17,209.65..17,209.75 rows=3 width=59) (actual time=60,297.784..60,297.799 rows=40 loops=1)

3. 1.057 60,297.266 ↓ 339.3 1,018 1

Group (cost=17,209.65..17,209.71 rows=3 width=51) (actual time=60,295.727..60,297.266 rows=1,018 loops=1)

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

Sort (cost=17,209.65..17,209.66 rows=3 width=51) (actual time=60,295.725..60,296.209 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.739 60,291.065 ↓ 676.7 2,030 1

Append (cost=9,135.11..17,209.63 rows=3 width=51) (actual time=30,324.153..60,291.065 rows=2,030 loops=1)

6. 0.553 30,325.044 ↓ 1,014.0 1,014 1

Unique (cost=9,135.11..9,135.13 rows=1 width=51) (actual time=30,324.153..30,325.044 rows=1,014 loops=1)

7. 2.986 30,324.491 ↓ 1,014.0 1,014 1

Sort (cost=9,135.11..9,135.12 rows=1 width=51) (actual time=30,324.152..30,324.491 rows=1,014 loops=1)

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

Nested Loop (cost=3,736.71..9,135.10 rows=1 width=51) (actual time=170.227..30,321.505 rows=1,014 loops=1)

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

Nested Loop (cost=3,561.15..8,881.06 rows=1 width=55) (actual time=165.131..26,216.284 rows=1,021 loops=1)

10. 3.208 26,173.706 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.87..8,878.11 rows=1 width=21) (actual time=165.050..26,173.706 rows=1,021 loops=1)

11. 907.602 26,163.351 ↓ 1,021.0 1,021 1

Nested Loop (cost=3,560.59..8,876.11 rows=1 width=25) (actual time=165.029..26,163.351 rows=1,021 loops=1)

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

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

13. 3.695 335.628 ↓ 1,022.0 1,022 1

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

14. 3.953 324.779 ↓ 1,022.0 1,022 1

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

15. 43.815 150.152 ↓ 1,022.0 1,022 1

Hash Right Join (cost=3,559.32..7,390.21 rows=1 width=12) (actual time=147.004..150.152 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. 30.784 30.784 ↑ 1.0 136,578 1

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

17. 1.975 75.553 ↓ 5.3 5,163 1

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

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

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

  • Hash Cond: (tsl."tsltscID" = tsc."tscID")
19. 31.227 31.227 ↑ 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.227 rows=136,578 loops=1)

20. 0.336 4.469 ↓ 5.8 1,022 1

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

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

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

  • Filter: (("tscIsExcluido" IS FALSE) AND ("tscMes" = 3) AND ("tscAno" = 2019))
  • Rows Removed by Filter: 23563
22. 170.674 170.674 ↑ 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.166..0.167 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,124.308 24,910.228 ↓ 139.6 3,768 1,022

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

  • Filter: ((tlsos.r = 1) AND (tlsos."tlsosSituacao" = ANY ('{3,7,9}'::integer[])))
  • Rows Removed by Filter: 12713
26. 12,846.540 19,785.920 ↑ 1.0 16,481 1,022

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

27. 6,939.380 6,939.380 ↑ 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.007..6.790 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. 39.819 39.819 ↑ 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.039 rows=1 loops=1,021)

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

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

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

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

32. 646.573 647.314 ↓ 1.0 2,443 1,021

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

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

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

34. 0.563 29,914.526 ↓ 1,015.0 1,015 1

Unique (cost=6,297.59..6,297.61 rows=1 width=51) (actual time=29,913.609..29,914.526 rows=1,015 loops=1)

35. 3.002 29,913.963 ↓ 1,015.0 1,015 1

Sort (cost=6,297.59..6,297.60 rows=1 width=51) (actual time=29,913.607..29,913.963 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. 439.753 29,910.961 ↓ 1,015.0 1,015 1

Nested Loop (cost=2,633.70..6,297.58 rows=1 width=51) (actual time=103.574..29,910.961 rows=1,015 loops=1)

  • Join Filter: (tos_1."tostclID" = thrfc_1."thrfctclID")
  • Rows Removed by Join Filter: 2023567
37. 3.053 25,886.032 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,458.15..6,043.53 rows=1 width=55) (actual time=99.016..25,886.032 rows=1,022 loops=1)

38. 3.644 25,845.165 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.86..6,040.68 rows=1 width=21) (actual time=98.961..25,845.165 rows=1,022 loops=1)

39. 860.280 25,835.389 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.59..6,038.68 rows=1 width=25) (actual time=98.944..25,835.389 rows=1,022 loops=1)

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

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

41. 2.880 143.803 ↓ 1,023.0 1,023 1

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

42. 2.956 133.762 ↓ 1,023.0 1,023 1

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

43. 25.391 90.909 ↓ 1,023.0 1,023 1

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

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

45. 0.689 46.029 ↓ 1.6 1,968 1

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

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

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

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

48. 0.301 2.839 ↓ 2.9 1,023 1

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

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

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

  • Filter: (("tfcmMes" = 3) AND ("tfcmAno" = 2019))
  • Rows Removed by Filter: 23571
50. 39.897 39.897 ↑ 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.038..0.039 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,069.988 24,822.072 ↓ 139.6 3,768 1,023

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

  • Filter: ((tlsos_1.r = 1) AND (tlsos_1."tlsosSituacao" = ANY ('{3,7,9}'::integer[])))
  • Rows Removed by Filter: 12713
54. 12,721.005 19,752.084 ↑ 1.0 16,481 1,023

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

55. 7,031.079 7,031.079 ↑ 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.007..6.873 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.006..0.006 rows=1 loops=1,022)

  • Index Cond: ("tseID" = tac_1."tactseID")
  • Filter: ("tseSistemaAgregado" = 2)
57. 37.814 37.814 ↑ 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.036..0.037 rows=1 loops=1,022)

  • Index Cond: ("tpeID" = tcl_1."tcltpeID")
  • Filter: ((COALESCE("tpeCNPJCPF", ''::text) ~~* '%%'::text) AND (proc_common_remove_acento("tpeNome") ~~* '%%'::text))
58. 997.472 3,585.176 ↓ 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.508 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,938.734 2,587.704 ↓ 1.0 2,443 1,022

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

60. 648.198 648.970 ↓ 1.0 2,443 1,022

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

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

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

62. 0.005 50.756 ↑ 1.0 1 1

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

63. 0.026 50.751 ↓ 3.0 3 1

Sort (cost=1,776.84..1,776.85 rows=1 width=51) (actual time=50.751..50.751 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.341 50.725 ↓ 3.0 3 1

Nested Loop (cost=192.19..1,776.83 rows=1 width=51) (actual time=24.110..50.725 rows=3 loops=1)

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

Nested Loop (cost=16.63..1,522.78 rows=1 width=55) (actual time=19.116..36.925 rows=3 loops=1)

66. 0.042 36.783 ↓ 3.0 3 1

Nested Loop (cost=16.35..1,520.04 rows=1 width=21) (actual time=19.028..36.783 rows=3 loops=1)

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

Nested Loop (cost=16.35..1,512.28 rows=1 width=29) (actual time=18.952..36.691 rows=1 loops=1)

68. 0.003 36.674 ↑ 1.0 1 1

Nested Loop (cost=16.07..1,510.28 rows=1 width=33) (actual time=18.939..36.674 rows=1 loops=1)

69. 0.022 36.663 ↑ 1.0 1 1

Nested Loop (cost=15.79..1,508.27 rows=1 width=25) (actual time=18.929..36.663 rows=1 loops=1)

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

Nested Loop (cost=15.51..1,506.09 rows=1 width=28) (actual time=18.902..36.633 rows=1 loops=1)

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

Nested Loop (cost=15.09..1,497.64 rows=1 width=24) (actual time=0.553..27.118 rows=3,768 loops=1)

72. 0.041 0.597 ↑ 1.0 1 1

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

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

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

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

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

75. 0.098 0.153 ↑ 1.7 151 1

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

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

Seq Scan on "TabSGQLogSituacao" (cost=0.00..4.56 rows=256 width=8) (actual time=0.015..0.055 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.768 24.830 ↓ 139.6 3,768 1

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

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

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

80. 7.020 7.020 ↑ 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..7.020 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.001..0.002 rows=1 loops=3,768)

  • Index Cond: ("tacID" = tsgqcm."tsgqcmtacID")
82. 0.008 0.008 ↑ 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.007..0.008 rows=1 loops=1)

  • Index Cond: ("tosID" = tac_2."tactosID")
83. 0.008 0.008 ↑ 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.008 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.009..0.010 rows=1 loops=1)

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

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

86. 0.117 0.117 ↑ 1.0 1 3

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

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

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

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

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

89. 2.970 3.648 ↓ 1.0 2,443 3

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

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

Planning time : 11.419 ms
Execution time : 60,298.864 ms