explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xQpw

Settings
# exclusive inclusive rows x rows loops node
1. 10,787.024 11,557.123 ↑ 83.3 12 1

Function Scan on generate_series mes (cost=11,038.88..77,996,900.41 rows=1,000 width=184) (actual time=1,116.052..11,557.123 rows=12 loops=1)

2.          

Initplan (for Function Scan)

3. 2.936 46.858 ↑ 1.0 1 1

Aggregate (cost=2,678.48..2,678.49 rows=1 width=8) (actual time=46.858..46.858 rows=1 loops=1)

4. 7.909 43.922 ↓ 85.8 12,695 1

Hash Join (cost=252.28..2,678.11 rows=148 width=8) (actual time=3.872..43.922 rows=12,695 loops=1)

  • Hash Cond: (trp_15."trptrecID" = trec_15."trecID")
5. 32.247 32.247 ↓ 78.8 15,593 1

Seq Scan on "TabReceitaParcela" trp_15 (cost=0.00..2,423.61 rows=198 width=12) (actual time=0.046..32.247 rows=15,593 loops=1)

  • Filter: (("trpBaixada" IS FALSE) AND ("trpPago" IS TRUE) AND ("trpSubstituida" IS FALSE) AND (NOT "trpIsExcluido") AND (date_part('year'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) = '2018'::double precision))
  • Rows Removed by Filter: 48062
6. 1.583 3.766 ↓ 1.0 5,354 1

Hash (cost=185.38..185.38 rows=5,352 width=4) (actual time=3.766..3.766 rows=5,354 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 253kB
7. 2.183 2.183 ↓ 1.0 5,354 1

Seq Scan on "TabReceita" trec_15 (cost=0.00..185.38 rows=5,352 width=4) (actual time=0.009..2.183 rows=5,354 loops=1)

  • Filter: ("trectemID" = ANY ('{1,2}'::integer[]))
  • Rows Removed by Filter: 1799
8. 0.305 60.193 ↑ 1.0 1 1

Aggregate (cost=8,360.37..8,360.39 rows=1 width=8) (actual time=60.193..60.193 rows=1 loops=1)

9.          

Initplan (for Aggregate)

10. 0.025 26.331 ↑ 1.0 1 1

Aggregate (cost=4,732.11..4,732.12 rows=1 width=8) (actual time=26.330..26.331 rows=1 loops=1)

11. 0.002 26.306 ↓ 0.0 0 1

Nested Loop (cost=936.32..4,732.10 rows=1 width=16) (actual time=26.306..26.306 rows=0 loops=1)

12. 22.470 26.304 ↓ 0.0 0 1

Bitmap Heap Scan on "TabReceitaParcela" trp_1_5 (cost=936.04..4,723.79 rows=1 width=20) (actual time=26.304..26.304 rows=0 loops=1)

  • Filter: (("trpPago" IS TRUE) AND ("trpSubstituida" IS FALSE) AND ("trpBaixada" IS FALSE) AND (NOT "trpIsExcluido") AND (date_part('year'::text, ("trpDataVencimento")::timestamp without time zone) = '2020'::double precision) AND (date_part('month'::text, ("trpDataVencimento")::timestamp without time zone) = '1'::double precision) AND (((date_part('year'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) = date_part('year'::text, ("trpDataVencimento")::timestamp without time zone)) AND (date_part('month'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) < date_part('month'::text, ("trpDataVencimento")::timestamp without time zone))) OR (date_part('year'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) < date_part('year'::text, ("trpDataVencimento")::timestamp without time zone))))
  • Rows Removed by Filter: 44717
  • Heap Blocks: exact=1304
13. 3.834 3.834 ↓ 1.1 44,717 1

Bitmap Index Scan on idx_trp_trppago_trpsubstituida_trpbaixada_trpdatavencimento (cost=0.00..936.04 rows=39,660 width=0) (actual time=3.834..3.834 rows=44,717 loops=1)

  • Index Cond: (("trpPago" = true) AND ("trpSubstituida" = false) AND ("trpBaixada" = false))
14. 0.000 0.000 ↓ 0.0 0

Index Scan using "TabReceita_trecID" on "TabReceita" trec_1_5 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: ("trecID" = trp_1_5."trptrecID")
  • Filter: ("trectemID" = ANY ('{5,1}'::integer[]))
15. 0.008 1.826 ↑ 1.0 1 1

Aggregate (cost=718.28..718.30 rows=1 width=8) (actual time=1.826..1.826 rows=1 loops=1)

16. 0.001 1.818 ↓ 0.0 0 1

Nested Loop (cost=522.71..718.28 rows=1 width=16) (actual time=1.818..1.818 rows=0 loops=1)

17. 0.000 1.817 ↓ 0.0 0 1

Nested Loop (cost=522.42..716.80 rows=1 width=4) (actual time=1.817..1.817 rows=0 loops=1)

  • Join Filter: (tlsos_11."tlsostosID" = tos_16."tosID")
18. 0.019 1.817 ↓ 0.0 0 1

Hash Join (cost=522.14..716.46 rows=1 width=12) (actual time=1.817..1.817 rows=0 loops=1)

  • Hash Cond: (trec_16."trectosID" = tlsos_11."tlsostosID")
19. 0.011 0.011 ↑ 7,150.0 1 1

Seq Scan on "TabReceita" trec_16 (cost=0.00..167.50 rows=7,150 width=8) (actual time=0.010..0.011 rows=1 loops=1)

20. 0.001 1.787 ↓ 0.0 0 1

Hash (cost=522.13..522.13 rows=1 width=4) (actual time=1.787..1.787 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
21. 0.001 1.786 ↓ 0.0 0 1

Subquery Scan on tlsos_11 (cost=521.28..522.13 rows=1 width=4) (actual time=1.786..1.786 rows=0 loops=1)

  • Filter: (tlsos_11.r = 1)
22. 0.000 1.785 ↓ 0.0 0 1

WindowAgg (cost=521.28..521.80 rows=26 width=68) (actual time=1.785..1.785 rows=0 loops=1)

23.          

Initplan (for WindowAgg)

24. 0.013 0.013 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=1)

25. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)

26. 0.011 1.783 ↓ 0.0 0 1

Sort (cost=521.25..521.31 rows=26 width=8) (actual time=1.783..1.783 rows=0 loops=1)

  • Sort Key: "TabLogSituacaoOrdemServico_11"."tlsostosID", "TabLogSituacaoOrdemServico_11"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
27. 1.772 1.772 ↓ 0.0 0 1

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_11" (cost=0.00..520.63 rows=26 width=8) (actual time=1.772..1.772 rows=0 loops=1)

  • Filter: (("tlsosDataHora" >= $90) AND ("tlsosDataHora" <= $91) AND ("tlsosSituacao" = ANY ('{3,9}'::integer[])))
  • Rows Removed by Filter: 18337
28. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_16 (cost=0.28..0.33 rows=1 width=4) (never executed)

  • Index Cond: ("tosID" = trec_16."trectosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_trp_trecid_trpsubstituida on "TabReceitaParcela" trp_16 (cost=0.29..1.47 rows=1 width=20) (never executed)

  • Index Cond: (("trptrecID" = trec_16."trecID") AND ("trpSubstituida" = false))
  • Filter: (("trpBaixada" IS FALSE) AND ("trpSubstituida" IS FALSE) AND (NOT "trpIsExcluido") AND (date_part('month'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) = '1'::double precision) AND (date_part('year'::text, COALESCE(("trpDataCompensacao")::timestamp with time zone, "trpDataRecebimento")) = '2020'::double precision))
30. 0.508 31.731 ↓ 762.0 762 1

Nested Loop (cost=0.56..2,909.95 rows=1 width=16) (actual time=0.260..31.731 rows=762 loops=1)

31. 0.794 29.697 ↓ 763.0 763 1

Nested Loop (cost=0.28..2,909.61 rows=1 width=20) (actual time=0.241..29.697 rows=763 loops=1)

32. 27.377 27.377 ↓ 763.0 763 1

Seq Scan on "TabReceitaParcela" trp_17 (cost=0.00..2,901.30 rows=1 width=20) (actual time=0.222..27.377 rows=763 loops=1)

  • Filter: (("trpBaixada" IS FALSE) AND ("trpSubstituida" IS FALSE) AND (NOT "trpIsExcluido") AND (date_part('month'::text, ("trpDataVencimento")::timestamp without time zone) = '1'::double precision) AND (date_part('year'::text, ("trpDataVencimento")::timestamp without time zone) = '2020'::double precision))
  • Rows Removed by Filter: 62892
33. 1.526 1.526 ↑ 1.0 1 763

Index Scan using "TabReceita_trecID" on "TabReceita" trec_17 (cost=0.28..8.30 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=763)

  • Index Cond: ("trecID" = trp_17."trptrecID")
34. 1.526 1.526 ↑ 1.0 1 763

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_17 (cost=0.28..0.33 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=763)

  • Index Cond: ("tosID" = trec_17."trectosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
35.          

SubPlan (for Function Scan)

36. 5.448 506.760 ↑ 1.0 1 12

Aggregate (cost=1,065.64..1,065.65 rows=1 width=8) (actual time=42.230..42.230 rows=1 loops=12)

37. 42.404 501.312 ↓ 364.6 1,823 12

Nested Loop (cost=813.35..1,065.63 rows=5 width=4) (actual time=13.989..41.776 rows=1,823 loops=12)

38. 58.776 419.676 ↓ 363.2 3,269 12

Subquery Scan on tlsos (cost=813.07..1,026.82 rows=9 width=4) (actual time=13.971..34.973 rows=3,269 loops=12)

  • Filter: ((tlsos."tlsosSituacao" = ANY ('{3,9}'::integer[])) AND (tlsos.r = 1))
  • Rows Removed by Filter: 13469
39. 145.668 360.900 ↓ 2.7 16,739 12

WindowAgg (cost=813.07..935.21 rows=6,107 width=68) (actual time=13.954..30.075 rows=16,739 loops=12)

40.          

Initplan (for WindowAgg)

41. 0.132 0.132 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=12)

42. 144.156 215.100 ↓ 2.7 16,739 12

Sort (cost=813.04..828.31 rows=6,107 width=12) (actual time=13.783..17.925 rows=16,739 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico"."tlsostosID", "TabLogSituacaoOrdemServico"."tlsosID" DESC
  • Sort Method: quicksort Memory: 1628kB
43. 70.944 70.944 ↓ 2.7 16,739 12

Seq Scan on "TabLogSituacaoOrdemServico" (cost=0.00..429.02 rows=6,107 width=12) (actual time=0.018..5.912 rows=16,739 loops=12)

  • Filter: ("tlsosDataHora" < $1)
  • Rows Removed by Filter: 1598
44. 39.232 39.232 ↑ 1.0 1 39,232

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos (cost=0.28..4.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=39,232)

  • Index Cond: ("tosID" = tlsos."tlsostosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 4
45. 0.180 29.796 ↑ 1.0 1 12

Aggregate (cost=526.46..526.47 rows=1 width=8) (actual time=2.483..2.483 rows=1 loops=12)

46. 1.288 29.616 ↓ 47.0 47 12

Nested Loop (cost=521.58..526.46 rows=1 width=4) (actual time=2.138..2.468 rows=47 loops=12)

47. 0.504 27.252 ↓ 90.0 90 12

Subquery Scan on tlsos_1 (cost=521.30..522.15 rows=1 width=4) (actual time=2.128..2.271 rows=90 loops=12)

  • Filter: (tlsos_1.r = 1)
  • Rows Removed by Filter: 0
48. 0.848 26.748 ↓ 3.5 90 12

WindowAgg (cost=521.30..521.82 rows=26 width=68) (actual time=2.125..2.229 rows=90 loops=12)

49.          

Initplan (for WindowAgg)

50. 0.156 0.156 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=12)

51. 0.040 0.040 ↑ 1.0 1 8

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=8)

52. 0.924 25.704 ↓ 3.5 90 12

Sort (cost=521.25..521.31 rows=26 width=8) (actual time=2.119..2.142 rows=90 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico_1"."tlsostosID", "TabLogSituacaoOrdemServico_1"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
53. 24.780 24.780 ↓ 3.5 90 12

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_1" (cost=0.00..520.63 rows=26 width=8) (actual time=1.608..2.065 rows=90 loops=12)

  • Filter: (("tlsosDataHora" >= $4) AND ("tlsosDataHora" <= $5) AND ("tlsosSituacao" = 3))
  • Rows Removed by Filter: 18247
54. 1.076 1.076 ↑ 1.0 1 1,076

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_1 (cost=0.28..4.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1,076)

  • Index Cond: ("tosID" = tlsos_1."tlsostosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 1
55. 0.036 21.240 ↑ 1.0 1 12

Aggregate (cost=525.05..525.06 rows=1 width=8) (actual time=1.770..1.770 rows=1 loops=12)

56. 0.048 21.204 ↓ 3.0 3 12

Nested Loop (cost=520.98..525.05 rows=1 width=4) (actual time=1.754..1.767 rows=3 loops=12)

57. 0.072 21.048 ↓ 3.0 3 12

Subquery Scan on tlsos_2 (cost=520.70..520.74 rows=1 width=4) (actual time=1.749..1.754 rows=3 loops=12)

  • Filter: (tlsos_2.r = 1)
58. 0.000 20.976 ↓ 3.0 3 12

WindowAgg (cost=520.70..520.72 rows=1 width=68) (actual time=1.745..1.748 rows=3 loops=12)

59.          

Initplan (for WindowAgg)

60. 0.060 0.060 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=12)

61. 0.032 0.032 ↑ 1.0 1 8

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=8)

62. 0.120 20.904 ↓ 3.0 3 12

Sort (cost=520.64..520.65 rows=1 width=8) (actual time=1.741..1.742 rows=3 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico_2"."tlsostosID", "TabLogSituacaoOrdemServico_2"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
63. 20.784 20.784 ↓ 3.0 3 12

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_2" (cost=0.00..520.63 rows=1 width=8) (actual time=1.530..1.732 rows=3 loops=12)

  • Filter: (("tlsosDataHora" >= $8) AND ("tlsosDataHora" <= $9) AND ("tlsosSituacao" = 9))
  • Rows Removed by Filter: 18334
64. 0.108 0.108 ↑ 1.0 1 36

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_2 (cost=0.28..4.30 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=36)

  • Index Cond: ("tosID" = tlsos_2."tlsostosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Heap Fetches: 0
65. 0.096 21.804 ↑ 1.0 1 12

Aggregate (cost=525.28..525.29 rows=1 width=8) (actual time=1.817..1.817 rows=1 loops=12)

66. 0.266 21.708 ↓ 20.0 20 12

Nested Loop (cost=521.05..525.28 rows=1 width=4) (actual time=1.718..1.809 rows=20 loops=12)

67. 0.144 20.952 ↓ 20.0 20 12

Subquery Scan on tlsos_3 (cost=520.77..520.96 rows=1 width=4) (actual time=1.712..1.746 rows=20 loops=12)

  • Filter: (tlsos_3.r = 1)
  • Rows Removed by Filter: 0
68. 0.196 20.808 ↓ 3.3 20 12

WindowAgg (cost=520.77..520.89 rows=6 width=68) (actual time=1.709..1.734 rows=20 loops=12)

69.          

Initplan (for WindowAgg)

70. 0.048 0.048 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=12)

71. 0.032 0.032 ↑ 1.0 1 8

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=8)

72. 0.216 20.532 ↓ 3.3 20 12

Sort (cost=520.71..520.73 rows=6 width=8) (actual time=1.706..1.711 rows=20 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico_3"."tlsostosID", "TabLogSituacaoOrdemServico_3"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
73. 20.316 20.316 ↓ 3.3 20 12

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_3" (cost=0.00..520.63 rows=6 width=8) (actual time=1.354..1.693 rows=20 loops=12)

  • Filter: (("tlsosDataHora" >= $12) AND ("tlsosDataHora" <= $13) AND ("tlsosSituacao" = ANY ('{7,8}'::integer[])))
  • Rows Removed by Filter: 18316
74. 0.490 0.490 ↑ 1.0 1 245

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_3 (cost=0.28..4.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=245)

  • Index Cond: ("tosID" = tlsos_3."tlsostosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
75. 0.036 28.572 ↑ 1.0 1 12

Aggregate (cost=485.42..485.43 rows=1 width=8) (actual time=2.381..2.381 rows=1 loops=12)

76. 0.044 28.536 ↓ 2.0 2 12

Nested Loop (cost=478.17..485.42 rows=1 width=4) (actual time=2.316..2.378 rows=2 loops=12)

77. 1.044 28.452 ↓ 2.0 2 12

Subquery Scan on tlsos_4 (cost=477.89..481.11 rows=1 width=4) (actual time=2.314..2.371 rows=2 loops=12)

  • Filter: ((tlsos_4."tlsosSituacao" = 5) AND (tlsos_4.r = 1))
  • Rows Removed by Filter: 388
78. 3.284 27.408 ↓ 4.2 390 12

WindowAgg (cost=477.89..479.73 rows=92 width=68) (actual time=1.917..2.284 rows=390 loops=12)

79.          

Initplan (for WindowAgg)

80. 0.048 0.048 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=12)

81. 0.040 0.040 ↑ 1.0 1 8

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=8)

82. 3.060 24.036 ↓ 4.2 390 12

Sort (cost=477.83..478.06 rows=92 width=12) (actual time=1.913..2.003 rows=390 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico_4"."tlsostosID", "TabLogSituacaoOrdemServico_4"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
83. 20.976 20.976 ↓ 4.2 390 12

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_4" (cost=0.00..474.83 rows=92 width=12) (actual time=1.052..1.748 rows=390 loops=12)

  • Filter: (("tlsosDataHora" >= $16) AND ("tlsosDataHora" <= $17))
  • Rows Removed by Filter: 17947
84. 0.040 0.040 ↑ 1.0 1 20

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_4 (cost=0.28..4.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=20)

  • Index Cond: ("tosID" = tlsos_4."tlsostosID")
  • Filter: ("tostemID" = ANY ('{5,1}'::integer[]))
  • Heap Fetches: 0
85. 0.132 54.876 ↑ 1.0 1 12

Aggregate (cost=717.12..717.13 rows=1 width=8) (actual time=4.573..4.573 rows=1 loops=12)

86. 6.552 54.744 ↓ 17.0 17 12

Nested Loop (cost=521.55..717.12 rows=1 width=16) (actual time=2.644..4.562 rows=17 loops=12)

87. 0.570 48.192 ↓ 33.0 33 12

Nested Loop (cost=521.26..715.64 rows=1 width=4) (actual time=1.837..4.016 rows=33 loops=12)

  • Join Filter: (tlsos_5."tlsostosID" = tos_5."tosID")
88. 13.550 46.824 ↓ 33.0 33 12

Hash Join (cost=520.98..715.30 rows=1 width=12) (actual time=1.824..3.902 rows=33 loops=12)

  • Hash Cond: (trec."trectosID" = tlsos_5."tlsostosID")
89. 12.166 12.166 ↓ 1.0 7,153 7

Seq Scan on "TabReceita" trec (cost=0.00..167.50 rows=7,150 width=8) (actual time=0.005..1.738 rows=7,153 loops=7)

90. 0.120 21.108 ↓ 20.0 20 12

Hash (cost=520.96..520.96 rows=1 width=4) (actual time=1.759..1.759 rows=20 loops=12)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
91. 0.156 20.988 ↓ 20.0 20 12

Subquery Scan on tlsos_5 (cost=520.77..520.96 rows=1 width=4) (actual time=1.718..1.749 rows=20 loops=12)

  • Filter: (tlsos_5.r = 1)
  • Rows Removed by Filter: 0
92. 0.128 20.832 ↓ 3.3 20 12

WindowAgg (cost=520.77..520.89 rows=6 width=68) (actual time=1.714..1.736 rows=20 loops=12)

93.          

Initplan (for WindowAgg)

94. 0.072 0.072 ↑ 1.0 1 12

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=12)

95. 0.040 0.040 ↑ 1.0 1 8

Result (cost=0.00..0.03 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=8)

96. 0.204 20.592 ↓ 3.3 20 12

Sort (cost=520.71..520.73 rows=6 width=8) (actual time=1.711..1.716 rows=20 loops=12)

  • Sort Key: "TabLogSituacaoOrdemServico_5"."tlsostosID", "TabLogSituacaoOrdemServico_5"."tlsosID" DESC
  • Sort Method: quicksort Memory: 25kB
97. 20.388 20.388 ↓ 3.3 20 12

Seq Scan on "TabLogSituacaoOrdemServico" "TabLogSituacaoOrdemServico_5" (cost=0.00..520.63 rows=6 width=8) (actual time=1.361..1.699 rows=20 loops=12)

  • Filter: (("tlsosDataHora" >= $20) AND ("tlsosDataHora" <= $21) AND ("tlsosSituacao" = ANY ('{7,8}'::integer[])))
  • Rows Removed by Filter: 18316
98. 0.798 0.798 ↑ 1.0 1 399

Index Only Scan using "TabOrdemServico_Unique_tosID_tostemID" on "TabOrdemServico" tos_5 (cost=0.28..0.33 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=399)

  • Index Cond: ("tosID" = trec."trectosID")