explain.depesz.com

A tool for finding a real cause for slow queries.

Result: Uap1

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

Sort (cost=194105.30..194109.97 rows=1866 width=351) (actual time=82336.801..84642.319 rows=278583 loops=1)

  • Sort Key: grupoproduto.cdgrupoproduto, produto.cdproduto
  • Sort Method: external merge Disk: 32160kB
2. 11199.179 77925.053 ↓ 149.3 278583 1

Nested Loop Left Join (cost=116.30..194003.92 rows=1866 width=351) (actual time=161.980..77925.053 rows=278583 loops=1)

3. 5018.420 45400.130 ↓ 149.3 278583 1

Hash Join (cost=116.30..39096.83 rows=1866 width=347) (actual time=161.867..45400.130 rows=278583 loops=1)

  • Hash Cond: (produto.cdgrupoproduto = grupoproduto.cdgrupoproduto)
4. 5257.884 40380.722 ↓ 149.3 278583 1

Hash Join (cost=114.56..39069.43 rows=1866 width=129) (actual time=160.820..40380.722 rows=278583 loops=1)

  • Hash Cond: (lancamento.cdproduto = produto.cdproduto)
5. 9792.404 35058.302 ↓ 149.3 278583 1

Nested Loop (cost=0.00..38924.55 rows=1866 width=96) (actual time=96.189..35058.302 rows=278583 loops=1)

6. 8263.318 16961.168 ↓ 147.3 286370 1

Nested Loop (cost=0.00..26575.40 rows=1944 width=68) (actual time=95.982..16961.168 rows=286370 loops=1)

7. 2261.256 2261.256 ↓ 147.3 173962 1

Seq Scan on lanccaixa (cost=0.00..17796.89 rows=1181 width=16) (actual time=95.813..2261.256 rows=173962 loops=1)

  • Filter: ((cdempresa = 1) AND (cdoperacaocaixa = 1) AND (flcancelado = 0) AND (date(dhlanccaixa) >= '2011-05-01'::date) AND (date(dhlanccaixa) < '2012-04-22'::date))
8. 6436.594 6436.594 ↑ 1.5 2 173962

Index Scan using ixlctocdlanccaixa on lancamento (cost=0.00..7.40 rows=3 width=64) (actual time=0.020..0.037 rows=2 loops=173962)

  • Index Cond: (cdlanccaixa = lanccaixa.cdlanccaixa)
  • Filter: (cdempresa = 1)
9. 8304.730 8304.730 ↑ 1.0 1 286370

Index Scan using pkdocfiscalitem on docfiscalitem (cost=0.00..6.34 rows=1 width=40) (actual time=0.019..0.029 rows=1 loops=286370)

  • Index Cond: (cddocfiscalitem = lancamento.cddocfiscalitem)
  • Filter: (cdempresa = 1)
10. 32.646 64.536 ↑ 1.0 2647 1

Hash (cost=81.47..81.47 rows=2647 width=33) (actual time=64.536..64.536 rows=2647 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 175kB
11. 31.890 31.890 ↑ 1.0 2647 1

Seq Scan on produto (cost=0.00..81.47 rows=2647 width=33) (actual time=0.019..31.890 rows=2647 loops=1)

12. 0.380 0.988 ↑ 1.0 33 1

Hash (cost=1.33..1.33 rows=33 width=222) (actual time=0.988..0.988 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
13. 0.608 0.608 ↑ 1.0 33 1

Seq Scan on grupoproduto (cost=0.00..1.33 rows=33 width=222) (actual time=0.310..0.608 rows=33 loops=1)

14. 8914.656 8914.656 ↑ 1.0 1 278583

Index Scan using ixcustocdempdtcdp on custo (cost=0.00..7.21 rows=1 width=24) (actual time=0.022..0.032 rows=1 loops=278583)

  • Index Cond: ((date(lanccaixa.dhlanccaixa) = dtcusto) AND (lancamento.cdproduto = cdproduto) AND (cdempresa = 1) AND (cdempresa = lancamento.cdempresa))
15.          

SubPlan (forNested Loop Left Join)

16. 1807.440 12411.088 ↑ 1.0 1 30124

Aggregate (cost=75.75..75.76 rows=1 width=16) (actual time=0.404..0.412 rows=1 loops=30124)

17. 4985.230 10603.648 ↑ 2.3 3 30124

Nested Loop (cost=0.00..75.72 rows=7 width=16) (actual time=0.077..0.352 rows=3 loops=30124)

18. 1958.060 1958.060 ↑ 1.6 5 30124

Index Scan using ixlanccomposicaocdl on lanccomposicao (cost=0.00..8.41 rows=8 width=12) (actual time=0.018..0.065 rows=5 loops=30124)

  • Index Cond: (cdlancamento = lancamento.cdlancamento)
19. 3660.358 3660.358 ↑ 1.0 1 140783

Index Scan using ixcustocdempdtcdp on custo (cost=0.00..8.40 rows=1 width=12) (actual time=0.019..0.026 rows=1 loops=140783)

  • Index Cond: ((dtcusto = date(lanccaixa.dhlanccaixa)) AND (cdproduto = lanccomposicao.cdproduto) AND (cdempresa = lancamento.cdempresa))