explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.075 61,015.163 ↓ 13.3 40 1

Limit (cost=17,209.65..17,209.75 rows=3 width=59) (actual time=61,015.077..61,015.163 rows=40 loops=1)

2. 0.583 61,015.088 ↓ 13.3 40 1

WindowAgg (cost=17,209.65..17,209.75 rows=3 width=59) (actual time=61,015.075..61,015.088 rows=40 loops=1)

3. 1.095 61,014.505 ↓ 339.3 1,018 1

Group (cost=17,209.65..17,209.71 rows=3 width=51) (actual time=61,012.866..61,014.505 rows=1,018 loops=1)

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

Sort (cost=17,209.65..17,209.66 rows=3 width=51) (actual time=61,012.864..61,013.410 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.759 61,008.400 ↓ 676.7 2,030 1

Append (cost=9,135.11..17,209.63 rows=3 width=51) (actual time=30,729.728..61,008.400 rows=2,030 loops=1)

6. 0.574 30,730.612 ↓ 1,014.0 1,014 1

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

7. 2.771 30,730.038 ↓ 1,014.0 1,014 1

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

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

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

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

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

10. 3.596 26,511.445 ↓ 1,021.0 1,021 1

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

11. 875.968 26,501.723 ↓ 1,021.0 1,021 1

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

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

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

13. 2.897 551.483 ↓ 1,022.0 1,022 1

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

14. 2.739 542.454 ↓ 1,022.0 1,022 1

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

15. 138.257 479.417 ↓ 1,022.0 1,022 1

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

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

17. 2.068 260.605 ↓ 5.3 5,163 1

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

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

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

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

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

20. 0.336 16.952 ↓ 5.8 1,022 1

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

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

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

  • Filter: (("tscIsExcluido" IS FALSE) AND ("tscMes" = 3) AND ("tscAno" = 2019))
  • Rows Removed by Filter: 23563
22. 60.298 60.298 ↑ 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.058..0.059 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,130.440 25,065.572 ↓ 139.6 3,768 1,022

Subquery Scan on tlsos (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.017..24.526 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,834.276 19,935.132 ↑ 1.0 16,481 1,022

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

27. 7,100.856 7,100.856 ↑ 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.948 rows=16,481 loops=1,022)

28. 6.126 6.126 ↑ 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.006 rows=1 loops=1,021)

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

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

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

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

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

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

32. 674.159 674.881 ↓ 1.0 2,443 1,021

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

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

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

34. 0.573 30,226.616 ↓ 1,015.0 1,015 1

Unique (cost=6,297.59..6,297.61 rows=1 width=51) (actual time=30,225.693..30,226.616 rows=1,015 loops=1)

35. 3.055 30,226.043 ↓ 1,015.0 1,015 1

Sort (cost=6,297.59..6,297.60 rows=1 width=51) (actual time=30,225.692..30,226.043 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. 442.843 30,222.988 ↓ 1,015.0 1,015 1

Nested Loop (cost=2,633.70..6,297.58 rows=1 width=51) (actual time=109.903..30,222.988 rows=1,015 loops=1)

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

Nested Loop (cost=2,458.15..6,043.53 rows=1 width=55) (actual time=105.252..26,120.363 rows=1,022 loops=1)

38. 3.666 26,079.225 ↓ 1,022.0 1,022 1

Nested Loop (cost=2,457.86..6,040.68 rows=1 width=21) (actual time=105.191..26,079.225 rows=1,022 loops=1)

39. 873.581 26,068.405 ↓ 1,022.0 1,022 1

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

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

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

41. 2.394 120.445 ↓ 1,023.0 1,023 1

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

42. 3.583 110.890 ↓ 1,023.0 1,023 1

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

43. 25.729 97.077 ↓ 1,023.0 1,023 1

Hash Right Join (cost=2,456.32..4,552.83 rows=1 width=12) (actual time=94.896..97.077 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.087 19.087 ↑ 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.087 rows=85,576 loops=1)

45. 0.810 52.261 ↓ 1.6 1,968 1

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

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

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

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

48. 0.318 3.039 ↓ 2.9 1,023 1

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

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

Seq Scan on "TabFUSTColetaMensal" tfcm (cost=0.00..616.32 rows=352 width=16) (actual time=0.052..2.721 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.005..0.007 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. 5,263.335 25,065.546 ↓ 139.6 3,768 1,023

Subquery Scan on tlsos_1 (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.018..24.502 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,662.694 19,802.211 ↑ 1.0 16,481 1,023

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

55. 7,139.517 7,139.517 ↑ 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.979 rows=16,481 loops=1,023)

56. 7.154 7.154 ↑ 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.007 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. 1,018.934 3,659.782 ↓ 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.581 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,990.856 2,640.848 ↓ 1.0 2,443 1,022

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

60. 649.120 649.992 ↓ 1.0 2,443 1,022

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

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

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

62. 0.002 50.413 ↑ 1.0 1 1

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

63. 0.027 50.411 ↓ 3.0 3 1

Sort (cost=1,776.84..1,776.85 rows=1 width=51) (actual time=50.409..50.411 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.295 50.384 ↓ 3.0 3 1

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

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

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

66. 0.045 36.902 ↓ 3.0 3 1

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

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

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

68. 0.004 36.799 ↑ 1.0 1 1

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

69. 0.013 36.788 ↑ 1.0 1 1

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

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

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

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

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

72. 0.036 0.762 ↑ 1.0 1 1

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

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

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

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

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

75. 0.107 0.188 ↑ 1.7 151 1

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

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

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

77. 0.360 0.360 ↑ 1.0 1 45

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

  • Filter: (("tsgqcmMes" = 3) AND ("tsgqcmAno" = 2019))
  • Rows Removed by Filter: 44
78. 5.067 24.640 ↓ 139.6 3,768 1

Subquery Scan on tlsos_2 (cost=0.29..1,472.58 rows=27 width=4) (actual time=0.037..24.640 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. 12.728 19.573 ↑ 1.0 16,481 1

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

80. 6.845 6.845 ↑ 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.845 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.005..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.007..0.007 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.042 0.042 ↑ 1.7 151 1

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

86. 0.099 0.099 ↑ 1.0 1 3

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

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

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

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

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

89. 3.075 3.558 ↓ 1.0 2,443 3

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

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

Planning time : 26.697 ms
Execution time : 61,016.191 ms