explain.depesz.com

A tool for finding a real cause for slow queries.

Result: oQd

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 198.998 702.431 ↓ 1.4 13,516 1

HashAggregate (cost=106,482.86..106,676.12 rows=9,663 width=86) (actual time=676.065..702.431 rows=13,516 loops=1)

2.          

CTE datas

3. 0.027 0.043 ↑ 1.0 1 1

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

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

Initplan (forIndex Scan)

5. 0.002 0.016 ↑ 1.0 1 1

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

6. 0.014 0.014 ↑ 12,686,295.0 1 1

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=0.014..0.014 rows=1 loops=1)

7.          

Initplan (forHashAggregate)

8. 0.002 0.002 ↑ 1.0 1 1

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

9. 0.002 0.002 ↑ 1.0 1 1

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

10. 0.002 0.002 ↑ 1.0 1 1

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

11. 0.002 0.002 ↑ 1.0 1 1

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

12. 0.047 0.047 ↑ 1.0 1 1

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

13. 0.002 0.020 ↑ 1.0 1 1

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

14. 0.018 0.018 ↑ 12,686,295.0 1 1

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=0.018..0.018 rows=1 loops=1)

15. 0.001 0.017 ↑ 1.0 1 1

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

16. 0.016 0.016 ↑ 12,686,295.0 1 1

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=0.016..0.016 rows=1 loops=1)

17. 0.001 0.008 ↑ 1.0 1 1

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

18. 0.007 0.007 ↑ 12,686,295.0 1 1

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=0.007..0.007 rows=1 loops=1)

19. 0.001 0.027 ↑ 1.0 1 1

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

20. 0.026 0.026 ↑ 12,686,295.0 1 1

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=0.026..0.026 rows=1 loops=1)

21. 0.001 0.013 ↑ 1.0 1 1

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

22. 0.012 0.012 ↑ 12,686,295.0 1 1

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=0.012..0.012 rows=1 loops=1)

23. 23.916 503.293 ↑ 1.0 39,237 1

Hash Left Join (cost=90,513.10..105,100.70 rows=39,237 width=86) (actual time=416.748..503.293 rows=39,237 loops=1)

  • Hash Cond: ((d.dbh_uor)::integer = rlz_557.ir_uor)
24. 24.561 470.530 ↑ 1.0 39,237 1

Hash Left Join (cost=80,247.06..93,224.96 rows=39,237 width=83) (actual time=407.876..470.530 rows=39,237 loops=1)

  • Hash Cond: ((d.dbh_uor)::integer = rlz_385.ir_uor)
25. 29.786 435.201 ↑ 1.0 39,237 1

Hash Right Join (cost=69,570.24..80,881.73 rows=39,237 width=76) (actual time=397.077..435.201 rows=39,237 loops=1)

  • Hash Cond: (rlz_386.ir_uor = (d.dbh_uor)::integer)
26. 1.090 8.427 ↓ 1.1 5,292 1

Append (cost=0.00..10,894.31 rows=4,959 width=11) (actual time=0.062..8.427 rows=5,292 loops=1)

27. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 386) AND (ir_data = $10))
28. 7.336 7.336 ↓ 1.1 5,292 1

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=0.059..7.336 rows=5,292 loops=1)

  • Index Cond: ((ir_data = $10) AND (ir_indicador = 386))
  • Filter: (ir_carteira = (-1))
29. 21.338 396.988 ↑ 1.0 39,237 1

Hash (cost=69,079.77..69,079.77 rows=39,237 width=69) (actual time=396.988..396.988 rows=39,237 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3541kB
30. 19.079 375.650 ↑ 1.0 39,237 1

Hash Right Join (cost=58,581.58..69,079.77 rows=39,237 width=69) (actual time=350.024..375.650 rows=39,237 loops=1)

  • Hash Cond: (rlz_383.ir_uor = (d.dbh_uor)::integer)
31. 0.937 6.783 ↓ 1.1 5,263 1

Append (cost=0.00..10,111.46 rows=4,597 width=11) (actual time=0.215..6.783 rows=5,263 loops=1)

32. 0.159 0.159 ↓ 0.0 0 1

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

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 383) AND (ir_data = $7))
33. 5.687 5.687 ↓ 1.1 5,263 1

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=0.055..5.687 rows=5,263 loops=1)

  • Index Cond: ((ir_data = $7) AND (ir_indicador = 383))
  • Filter: (ir_carteira = (-1))
34. 19.016 349.788 ↑ 1.0 39,237 1

Hash (cost=58,091.11..58,091.11 rows=39,237 width=62) (actual time=349.788..349.788 rows=39,237 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3358kB
35. 18.303 330.772 ↑ 1.0 39,237 1

Hash Right Join (cost=47,962.29..58,091.11 rows=39,237 width=62) (actual time=306.285..330.772 rows=39,237 loops=1)

  • Hash Cond: (rlz_384.ir_uor = (d.dbh_uor)::integer)
36. 0.685 6.250 ↓ 1.2 5,252 1

Append (cost=0.00..9,755.98 rows=4,432 width=11) (actual time=0.043..6.250 rows=5,252 loops=1)

37. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 384) AND (ir_data = $8))
38. 5.564 5.564 ↓ 1.2 5,252 1

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=0.042..5.564 rows=5,252 loops=1)

  • Index Cond: ((ir_data = $8) AND (ir_indicador = 384))
  • Filter: (ir_carteira = (-1))
39. 15.457 306.219 ↑ 1.0 39,237 1

Hash (cost=47,471.82..47,471.82 rows=39,237 width=55) (actual time=306.219..306.219 rows=39,237 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 3160kB
40. 16.511 290.762 ↑ 1.0 39,237 1

Hash Right Join (cost=38,735.97..47,471.82 rows=39,237 width=55) (actual time=265.512..290.762 rows=39,237 loops=1)

  • Hash Cond: (orc_385.io_uor = (d.dbh_uor)::integer)
41. 0.606 10.902 ↑ 1.0 5,279 1

Append (cost=0.00..8,282.70 rows=5,387 width=10) (actual time=2.145..10.902 rows=5,279 loops=1)

42. 0.002 0.002 ↓ 0.0 0 1

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

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 385) AND (io_data = $4))
43. 9.081 10.294 ↑ 1.0 5,279 1

Bitmap Heap Scan on indicadores_orcado_prefixo orc_385 (cost=211.80..8,282.70 rows=5,386 width=10) (actual time=2.143..10.294 rows=5,279 loops=1)

  • Recheck Cond: ((io_data = $4) AND (io_indicador = 385))
  • Filter: (io_carteira = (-1))
44. 1.213 1.213 ↑ 1.0 5,279 1

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..210.45 rows=5,386 width=0) (actual time=1.213..1.213 rows=5,279 loops=1)

  • Index Cond: ((io_data = $4) AND (io_indicador = 385))
45. 14.813 263.349 ↑ 1.0 39,237 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 3008kB
46. 15.137 248.536 ↑ 1.0 39,237 1

Hash Right Join (cost=29,813.33..38,245.50 rows=39,237 width=49) (actual time=224.328..248.536 rows=39,237 loops=1)

  • Hash Cond: (orc_384.io_uor = (d.dbh_uor)::integer)
47. 0.765 11.253 ↓ 1.1 5,271 1

Append (cost=0.00..8,015.03 rows=4,959 width=10) (actual time=2.159..11.253 rows=5,271 loops=1)

48. 0.002 0.002 ↓ 0.0 0 1

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

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 384) AND (io_data = $3))
49. 9.256 10.486 ↓ 1.1 5,271 1

Bitmap Heap Scan on indicadores_orcado_prefixo orc_384 (cost=195.41..8,015.03 rows=4,958 width=10) (actual time=2.157..10.486 rows=5,271 loops=1)

  • Recheck Cond: ((io_data = $3) AND (io_indicador = 384))
  • Filter: (io_carteira = (-1))
50. 1.230 1.230 ↓ 1.1 5,271 1

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..194.17 rows=4,958 width=0) (actual time=1.230..1.230 rows=5,271 loops=1)

  • Index Cond: ((io_data = $3) AND (io_indicador = 384))
51. 14.317 222.146 ↑ 1.0 39,237 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 2706kB
52. 14.309 207.829 ↑ 1.0 39,237 1

Hash Right Join (cost=20,899.18..29,322.87 rows=39,237 width=43) (actual time=184.912..207.829 rows=39,237 loops=1)

  • Hash Cond: (orc_386.io_uor = (d.dbh_uor)::integer)
53. 0.646 10.907 ↓ 1.1 5,280 1

Append (cost=0.00..8,007.63 rows=4,946 width=10) (actual time=2.280..10.907 rows=5,280 loops=1)

54. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 386) AND (io_data = $5))
55. 8.874 10.260 ↓ 1.1 5,280 1

Bitmap Heap Scan on indicadores_orcado_prefixo orc_386 (cost=195.28..8,007.63 rows=4,945 width=10) (actual time=2.278..10.260 rows=5,280 loops=1)

  • Recheck Cond: ((io_data = $5) AND (io_indicador = 386))
  • Filter: (io_carteira = (-1))
56. 1.386 1.386 ↓ 1.1 5,280 1

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..194.04 rows=4,945 width=0) (actual time=1.386..1.386 rows=5,280 loops=1)

  • Index Cond: ((io_data = $5) AND (io_indicador = 386))
57. 17.446 182.613 ↑ 1.0 39,237 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 2547kB
58. 17.312 165.167 ↑ 1.0 39,237 1

Hash Right Join (cost=11,811.32..20,408.72 rows=39,237 width=37) (actual time=136.308..165.167 rows=39,237 loops=1)

  • Hash Cond: (orc_383.io_uor = (d.dbh_uor)::integer)
59. 1.172 15.645 ↓ 1.0 5,265 1

Append (cost=0.00..8,161.41 rows=5,183 width=10) (actual time=4.073..15.645 rows=5,265 loops=1)

60. 0.002 0.002 ↓ 0.0 0 1

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

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 383) AND (io_data = $2))
61. 12.153 14.471 ↓ 1.0 5,265 1

Bitmap Heap Scan on indicadores_orcado_prefixo orc_383 (cost=205.71..8,161.41 rows=5,182 width=10) (actual time=4.071..14.471 rows=5,265 loops=1)

  • Recheck Cond: ((io_data = $2) AND (io_indicador = 383))
  • Filter: (io_carteira = (-1))
62. 2.318 2.318 ↓ 1.0 5,265 1

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..204.41 rows=5,182 width=0) (actual time=2.318..2.318 rows=5,265 loops=1)

  • Index Cond: ((io_data = $2) AND (io_indicador = 383))
63. 24.454 132.210 ↑ 1.0 39,237 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 2407kB
64. 25.789 107.756 ↑ 1.0 39,237 1

Hash Right Join (cost=2,791.83..11,320.85 rows=39,237 width=31) (actual time=69.428..107.756 rows=39,237 loops=1)

  • Hash Cond: (orc_557.io_uor = (d.dbh_uor)::integer)
65. 1.048 16.429 ↑ 1.1 4,747 1

Append (cost=0.00..8,100.85 rows=5,090 width=10) (actual time=3.868..16.429 rows=4,747 loops=1)

66. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((io_carteira = (-1)) AND (io_indicador = 557) AND (io_data = $6))
67. 13.073 15.380 ↑ 1.1 4,747 1

Bitmap Heap Scan on indicadores_orcado_prefixo orc_557 (cost=200.75..8,100.85 rows=5,089 width=10) (actual time=3.867..15.380 rows=4,747 loops=1)

  • Recheck Cond: ((io_data = $6) AND (io_indicador = 557))
  • Filter: (io_carteira = (-1))
68. 2.307 2.307 ↑ 1.1 4,747 1

Bitmap Index Scan on indicadores_orcado_prefixo_pk (cost=0.00..199.48 rows=5,089 width=0) (actual time=2.307..2.307 rows=4,747 loops=1)

  • Index Cond: ((io_data = $6) AND (io_indicador = 557))
69. 25.778 65.538 ↑ 1.0 39,237 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 2262kB
70. 9.373 39.760 ↑ 1.0 39,237 1

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

71. 7.302 7.302 ↑ 1.0 9,220 1

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

72. 23.085 23.085 ↑ 1.0 30,017 1

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

73. 2.513 10.768 ↓ 1.1 5,272 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 243kB
74. 1.289 8.255 ↓ 1.1 5,272 1

Append (cost=0.00..10,616.45 rows=4,830 width=11) (actual time=0.027..8.255 rows=5,272 loops=1)

75. 0.001 0.001 ↓ 0.0 0 1

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

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 385) AND (ir_data = $9))
76. 6.965 6.965 ↓ 1.1 5,272 1

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=0.025..6.965 rows=5,272 loops=1)

  • Index Cond: ((ir_data = $9) AND (ir_indicador = 385))
  • Filter: (ir_carteira = (-1))
77. 2.033 8.847 ↓ 1.1 5,051 1

Hash (cost=10,208.05..10,208.05 rows=4,640 width=11) (actual time=8.847..8.847 rows=5,051 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 232kB
78. 1.122 6.814 ↓ 1.1 5,051 1

Append (cost=0.00..10,208.05 rows=4,640 width=11) (actual time=0.044..6.814 rows=5,051 loops=1)

79. 0.002 0.002 ↓ 0.0 0 1

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

  • Filter: ((ir_carteira = (-1)) AND (ir_indicador = 557) AND (ir_data = $11))
80. 5.690 5.690 ↓ 1.1 5,051 1

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=0.040..5.690 rows=5,051 loops=1)

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