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=106,482.86..106,676.12 rows=9,663 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..907,672.32 rows=12,686,295 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..907,672.32 rows=12,686,295 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..907,672.32 rows=12,686,295 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..907,672.32 rows=12,686,295 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..907,672.32 rows=12,686,295 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..907,672.32 rows=12,686,295 width=4) (actual time=.. rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=90,513.10..105,100.70 rows=39,237 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=80,247.06..93,224.96 rows=39,237 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=69,570.24..80,881.73 rows=39,237 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..10,894.31 rows=4,959 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..10,894.31 rows=4,958 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=69,079.77..69,079.77 rows=39,237 width=69) (actual time=.. rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=58,581.58..69,079.77 rows=39,237 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..10,111.46 rows=4,597 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..10,111.46 rows=4,596 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=58,091.11..58,091.11 rows=39,237 width=62) (actual time=.. rows= loops=)

35. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=47,962.29..58,091.11 rows=39,237 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..9,755.98 rows=4,432 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..9,755.98 rows=4,431 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=47,471.82..47,471.82 rows=39,237 width=55) (actual time=.. rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=38,735.97..47,471.82 rows=39,237 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..8,282.70 rows=5,387 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..8,282.70 rows=5,386 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=5,386 width=0) (actual time=.. rows= loops=)

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

Hash (cost=38,245.50..38,245.50 rows=39,237 width=49) (actual time=.. rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=29,813.33..38,245.50 rows=39,237 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..8,015.03 rows=4,959 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..8,015.03 rows=4,958 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=4,958 width=0) (actual time=.. rows= loops=)

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

Hash (cost=29,322.87..29,322.87 rows=39,237 width=43) (actual time=.. rows= loops=)

52. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=20,899.18..29,322.87 rows=39,237 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..8,007.63 rows=4,946 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..8,007.63 rows=4,945 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=4,945 width=0) (actual time=.. rows= loops=)

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

Hash (cost=20,408.72..20,408.72 rows=39,237 width=37) (actual time=.. rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=11,811.32..20,408.72 rows=39,237 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..8,161.41 rows=5,183 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..8,161.41 rows=5,182 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=5,182 width=0) (actual time=.. rows= loops=)

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

Hash (cost=11,320.85..11,320.85 rows=39,237 width=31) (actual time=.. rows= loops=)

64. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=2,791.83..11,320.85 rows=39,237 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..8,100.85 rows=5,090 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..8,100.85 rows=5,089 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=5,089 width=0) (actual time=.. rows= loops=)

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

Hash (cost=2,301.37..2,301.37 rows=39,237 width=25) (actual time=.. rows= loops=)

70. 0.000 0.000 ↓ 0.0

Append (cost=0.00..2,301.37 rows=39,237 width=25) (actual time=.. rows= loops=)

71. 0.000 0.000 ↓ 0.0

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

72. 0.000 0.000 ↓ 0.0

Seq Scan on prefixos_historico d (cost=0.00..1,518.17 rows=30,017 width=25) (actual time=.. rows= loops=)

73. 0.000 0.000 ↓ 0.0

Hash (cost=10,616.45..10,616.45 rows=4,830 width=11) (actual time=.. rows= loops=)

74. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10,616.45 rows=4,830 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..10,616.45 rows=4,829 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=10,208.05..10,208.05 rows=4,640 width=11) (actual time=.. rows= loops=)

78. 0.000 0.000 ↓ 0.0

Append (cost=0.00..10,208.05 rows=4,640 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..10,208.05 rows=4,639 width=11) (actual time=.. rows= loops=)

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