explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RYuK

Settings
# exclusive inclusive rows x rows loops node
1. 32,370.436 40,668.411 ↓ 1.0 331,892 1

Hash Join (cost=417,691.32..1,048,183.27 rows=324,386 width=273) (actual time=5,890.133..40,668.411 rows=331,892 loops=1)

  • Hash Cond: (h.filial = g.filial)
  • Functions: 53
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 44.162 ms, Inlining 188.481 ms, Optimization 876.320 ms, Emission 604.397 ms, Total 1713.361 ms
2. 277.411 6,621.025 ↓ 1.0 331,892 1

Hash Join (cost=417,690.08..788,267.74 rows=324,386 width=137) (actual time=4,211.778..6,621.025 rows=331,892 loops=1)

  • Hash Cond: ((p.nivel_servico)::text = (ns.descricao_nivel_servico)::text)
3. 215.412 6,343.591 ↓ 1.0 331,892 1

Hash Join (cost=417,688.94..783,806.30 rows=324,386 width=145) (actual time=4,211.668..6,343.591 rows=331,892 loops=1)

  • Hash Cond: (p.idfamilia_produto = familia_produtos.idfamilia_produto)
4. 1,065.657 6,128.150 ↑ 1.0 334,202 1

Hash Join (cost=417,687.12..782,817.80 rows=334,216 width=149) (actual time=4,211.609..6,128.150 rows=334,202 loops=1)

  • Hash Cond: ((h.filial = p.filial) AND ((h.idproduto)::text = (p.idproduto)::text))
5. 617.902 2,884.051 ↑ 1.0 334,202 1

Hash Join (cost=216,863.97..567,546.71 rows=334,652 width=65) (actual time=2,032.701..2,884.051 rows=334,202 loops=1)

  • Hash Cond: ((s.filial = h.filial) AND ((s.idproduto)::text = (h.idproduto)::text))
6. 235.529 235.529 ↓ 1.0 334,211 1

Index Scan using saldo_filiais_data_idx on saldo_filiais s (cost=0.57..342,111.39 rows=332,175 width=24) (actual time=0.169..235.529 rows=334,211 loops=1)

  • Index Cond: (data = (CURRENT_DATE - 1))
7. 211.439 2,030.620 ↓ 1.0 334,202 1

Hash (cost=208,923.68..208,923.68 rows=333,714 width=45) (actual time=2,030.620..2,030.620 rows=334,202 loops=1)

  • Buckets: 262144 Batches: 4 Memory Usage: 8719kB
8. 157.289 1,819.181 ↓ 1.0 334,202 1

Bitmap Heap Scan on hist_analise_compras_filial h (cost=110,534.69..208,923.68 rows=333,714 width=45) (actual time=1,662.607..1,819.181 rows=334,202 loops=1)

  • Recheck Cond: (data_solicitacao = (CURRENT_DATE - 1))
  • Heap Blocks: exact=3509
9. 1,661.892 1,661.892 ↓ 1.0 334,202 1

Bitmap Index Scan on pk_hist_analise_comp_fil (cost=0.00..110,451.26 rows=333,714 width=0) (actual time=1,661.892..1,661.892 rows=334,202 loops=1)

  • Index Cond: (data_solicitacao = (CURRENT_DATE - 1))
10. 294.028 2,178.442 ↓ 1.0 334,752 1

Hash (cost=191,013.46..191,013.46 rows=330,846 width=94) (actual time=2,178.442..2,178.442 rows=334,752 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 11877kB
11. 1,884.414 1,884.414 ↓ 1.0 334,752 1

Seq Scan on produtos_filial p (cost=0.00..191,013.46 rows=330,846 width=94) (actual time=0.925..1,884.414 rows=334,752 loops=1)

12. 0.010 0.029 ↑ 1.0 33 1

Hash (cost=1.41..1.41 rows=33 width=4) (actual time=0.029..0.029 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
13. 0.019 0.019 ↑ 1.0 33 1

Seq Scan on familia_produtos (cost=0.00..1.41 rows=33 width=4) (actual time=0.013..0.019 rows=33 loops=1)

  • Filter: ((filtro)::text = 'N'::text)
14. 0.007 0.023 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=20) (actual time=0.023..0.023 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.016 0.016 ↑ 1.0 6 1

Seq Scan on nivel_servico ns (cost=0.00..1.06 rows=6 width=20) (actual time=0.014..0.016 rows=6 loops=1)

16. 0.030 1,676.950 ↑ 1.0 11 1

Hash (cost=1.11..1.11 rows=11 width=16) (actual time=1,676.950..1,676.950 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 1,676.920 1,676.920 ↑ 1.0 11 1

Seq Scan on grupo_filial g (cost=0.00..1.11 rows=11 width=16) (actual time=1,676.912..1,676.920 rows=11 loops=1)

Execution time : 40,794.401 ms