explain.depesz.com

A tool for finding a real cause for slow queries.

Result: BMqP

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

HashAggregate (cost=106482.86..106676.12 rows=9663 width=86) (actual time=.. rows= loops=)

2.          

CTE datas

3. 0.000 0.000 ↓ 0.0

Index Scan using pk_mapa_datas_ref on mapa_datas datas (cost=0.08..8.36 rows=1 width=16) (actual time=.. rows= loops=)

  • Index Cond: (md_data_ref = $0)
4.          

Initplan (forIndex Scan)

5. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

7.          

Initplan (forHashAggregate)

8. 0.000 0.000 ↓ 0.0

CTE Scan on datas (cost=0.00..0.02 rows=1 width=4) (actual time=.. rows= loops=)

9. 0.000 0.000 ↓ 0.0

CTE Scan on datas (cost=0.00..0.02 rows=1 width=4) (actual time=.. rows= loops=)

10. 0.000 0.000 ↓ 0.0

CTE Scan on datas (cost=0.00..0.02 rows=1 width=4) (actual time=.. rows= loops=)

11. 0.000 0.000 ↓ 0.0

CTE Scan on datas (cost=0.00..0.02 rows=1 width=4) (actual time=.. rows= loops=)

12. 0.000 0.000 ↓ 0.0

CTE Scan on datas (cost=0.00..0.02 rows=1 width=4) (actual time=.. rows= loops=)

13. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

15. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

17. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

19. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

20. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

21. 0.000 0.000 ↓ 0.0

Limit (cost=0.00..0.07 rows=1 width=4) (actual time=.. rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan Backward using indicadores_realizado_prefixo_common_idx on indicadores_realizado_prefixo (cost=0.00..907672.32 rows=12686295 width=4) (actual time=.. rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=90513.10..105100.70 rows=39237 width=86) (actual time=.. rows= loops=)

  • Hash Cond: ((d.dbh_uor)::integer = rlz_557.ir_uor)
24. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=80247.06..93224.96 rows=39237 width=83) (actual time=.. rows= loops=)

  • Hash Cond: ((d.dbh_uor)::integer = rlz_385.ir_uor)
25. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=69570.24..80881.73 rows=39237 width=76) (actual time=.. rows= loops=)

  • Hash Cond: (rlz_386.ir_uor = (d.dbh_uor)::integer)
26. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10894.31 rows=4959 width=11) (actual time=.. rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_realizado rlz_386 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 386) AND (ir_data = $10))
28. 0.000 0.000 ↓ 0.0

Index Scan using indicadores_realiado_prefixo_pk on indicadores_realizado_prefixo rlz_386 (cost=0.00..10894.31 rows=4958 width=11) (actual time=.. rows= loops=)

  • Index Cond: ((ir_data = $10) AND (ir_indicador = 386))
  • Filter: (ir_carteira = (-1))
29. 0.000 0.000 ↓ 0.0

Hash (cost=69079.77..69079.77 rows=39237 width=69) (actual time=.. rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=58581.58..69079.77 rows=39237 width=69) (actual time=.. rows= loops=)

  • Hash Cond: (rlz_383.ir_uor = (d.dbh_uor)::integer)
31. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10111.46 rows=4597 width=11) (actual time=.. rows= loops=)

32. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_realizado rlz_383 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 383) AND (ir_data = $7))
33. 0.000 0.000 ↓ 0.0

Index Scan using indicadores_realiado_prefixo_pk on indicadores_realizado_prefixo rlz_383 (cost=0.00..10111.46 rows=4596 width=11) (actual time=.. rows= loops=)

  • Index Cond: ((ir_data = $7) AND (ir_indicador = 383))
  • Filter: (ir_carteira = (-1))
34. 0.000 0.000 ↓ 0.0

Hash (cost=58091.11..58091.11 rows=39237 width=62) (actual time=.. rows= loops=)

35. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=47962.29..58091.11 rows=39237 width=62) (actual time=.. rows= loops=)

  • Hash Cond: (rlz_384.ir_uor = (d.dbh_uor)::integer)
36. 0.000 0.000 ↓ 0.0

Append (cost=0.00..9755.98 rows=4432 width=11) (actual time=.. rows= loops=)

37. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_realizado rlz_384 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 384) AND (ir_data = $8))
38. 0.000 0.000 ↓ 0.0

Index Scan using indicadores_realiado_prefixo_pk on indicadores_realizado_prefixo rlz_384 (cost=0.00..9755.98 rows=4431 width=11) (actual time=.. rows= loops=)

  • Index Cond: ((ir_data = $8) AND (ir_indicador = 384))
  • Filter: (ir_carteira = (-1))
39. 0.000 0.000 ↓ 0.0

Hash (cost=47471.82..47471.82 rows=39237 width=55) (actual time=.. rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=38735.97..47471.82 rows=39237 width=55) (actual time=.. rows= loops=)

  • Hash Cond: (orc_385.io_uor = (d.dbh_uor)::integer)
41. 0.000 0.000 ↓ 0.0

Append (cost=0.00..8282.70 rows=5387 width=10) (actual time=.. rows= loops=)

42. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_orcado orc_385 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 385) AND (io_data = $4))
43. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on indicadores_orcado_prefixo orc_385 (cost=211.80..8282.70 rows=5386 width=10) (actual time=.. rows= loops=)

  • Recheck Cond: ((io_data = $4) AND (io_indicador = 385))
  • Filter: (io_carteira = (-1))
44. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..210.45 rows=5386 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((io_data = $4) AND (io_indicador = 385))
45. 0.000 0.000 ↓ 0.0

Hash (cost=38245.50..38245.50 rows=39237 width=49) (actual time=.. rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=29813.33..38245.50 rows=39237 width=49) (actual time=.. rows= loops=)

  • Hash Cond: (orc_384.io_uor = (d.dbh_uor)::integer)
47. 0.000 0.000 ↓ 0.0

Append (cost=0.00..8015.03 rows=4959 width=10) (actual time=.. rows= loops=)

48. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_orcado orc_384 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 384) AND (io_data = $3))
49. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on indicadores_orcado_prefixo orc_384 (cost=195.41..8015.03 rows=4958 width=10) (actual time=.. rows= loops=)

  • Recheck Cond: ((io_data = $3) AND (io_indicador = 384))
  • Filter: (io_carteira = (-1))
50. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..194.17 rows=4958 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((io_data = $3) AND (io_indicador = 384))
51. 0.000 0.000 ↓ 0.0

Hash (cost=29322.87..29322.87 rows=39237 width=43) (actual time=.. rows= loops=)

52. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20899.18..29322.87 rows=39237 width=43) (actual time=.. rows= loops=)

  • Hash Cond: (orc_386.io_uor = (d.dbh_uor)::integer)
53. 0.000 0.000 ↓ 0.0

Append (cost=0.00..8007.63 rows=4946 width=10) (actual time=.. rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_orcado orc_386 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 386) AND (io_data = $5))
55. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on indicadores_orcado_prefixo orc_386 (cost=195.28..8007.63 rows=4945 width=10) (actual time=.. rows= loops=)

  • Recheck Cond: ((io_data = $5) AND (io_indicador = 386))
  • Filter: (io_carteira = (-1))
56. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..194.04 rows=4945 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((io_data = $5) AND (io_indicador = 386))
57. 0.000 0.000 ↓ 0.0

Hash (cost=20408.72..20408.72 rows=39237 width=37) (actual time=.. rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=11811.32..20408.72 rows=39237 width=37) (actual time=.. rows= loops=)

  • Hash Cond: (orc_383.io_uor = (d.dbh_uor)::integer)
59. 0.000 0.000 ↓ 0.0

Append (cost=0.00..8161.41 rows=5183 width=10) (actual time=.. rows= loops=)

60. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_orcado orc_383 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 383) AND (io_data = $2))
61. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on indicadores_orcado_prefixo orc_383 (cost=205.71..8161.41 rows=5182 width=10) (actual time=.. rows= loops=)

  • Recheck Cond: ((io_data = $2) AND (io_indicador = 383))
  • Filter: (io_carteira = (-1))
62. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..204.41 rows=5182 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((io_data = $2) AND (io_indicador = 383))
63. 0.000 0.000 ↓ 0.0

Hash (cost=11320.85..11320.85 rows=39237 width=31) (actual time=.. rows= loops=)

64. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=2791.83..11320.85 rows=39237 width=31) (actual time=.. rows= loops=)

  • Hash Cond: (orc_557.io_uor = (d.dbh_uor)::integer)
65. 0.000 0.000 ↓ 0.0

Append (cost=0.00..8100.85 rows=5090 width=10) (actual time=.. rows= loops=)

66. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_orcado orc_557 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 557) AND (io_data = $6))
67. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on indicadores_orcado_prefixo orc_557 (cost=200.75..8100.85 rows=5089 width=10) (actual time=.. rows= loops=)

  • Recheck Cond: ((io_data = $6) AND (io_indicador = 557))
  • Filter: (io_carteira = (-1))
68. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..199.48 rows=5089 width=0) (actual time=.. rows= loops=)

  • Index Cond: ((io_data = $6) AND (io_indicador = 557))
69. 0.000 0.000 ↓ 0.0

Hash (cost=2301.37..2301.37 rows=39237 width=25) (actual time=.. rows= loops=)

70. 0.000 0.000 ↓ 0.0

Append (cost=0.00..2301.37 rows=39237 width=25) (actual time=.. rows= loops=)

71. 0.000 0.000 ↓ 0.0

Seq Scan on prefixos d (cost=0.00..783.20 rows=9220 width=25) (actual time=.. rows= loops=)

72. 0.000 0.000 ↓ 0.0

Seq Scan on prefixos_historico d (cost=0.00..1518.17 rows=30017 width=25) (actual time=.. rows= loops=)

73. 0.000 0.000 ↓ 0.0

Hash (cost=10616.45..10616.45 rows=4830 width=11) (actual time=.. rows= loops=)

74. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10616.45 rows=4830 width=11) (actual time=.. rows= loops=)

75. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_realizado rlz_385 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 385) AND (ir_data = $9))
76. 0.000 0.000 ↓ 0.0

Index Scan using indicadores_realiado_prefixo_pk on indicadores_realizado_prefixo rlz_385 (cost=0.00..10616.45 rows=4829 width=11) (actual time=.. rows= loops=)

  • Index Cond: ((ir_data = $9) AND (ir_indicador = 385))
  • Filter: (ir_carteira = (-1))
77. 0.000 0.000 ↓ 0.0

Hash (cost=10208.05..10208.05 rows=4640 width=11) (actual time=.. rows= loops=)

78. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10208.05 rows=4640 width=11) (actual time=.. rows= loops=)

79. 0.000 0.000 ↓ 0.0

Seq Scan on indicadores_realizado rlz_557 (cost=0.00..0.00 rows=1 width=22) (actual time=.. rows= loops=)

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 557) AND (ir_data = $11))
80. 0.000 0.000 ↓ 0.0

Index Scan using indicadores_realiado_prefixo_pk on indicadores_realizado_prefixo rlz_557 (cost=0.00..10208.05 rows=4639 width=11) (actual time=.. rows= loops=)

  • Index Cond: ((ir_data = $11) AND (ir_indicador = 557))
  • Filter: (ir_carteira = (-1))