explain.depesz.com

A tool for finding a real cause for slow queries.

Result: sPD

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

Nested Loop Left Join (cost=130.63..186614.60 rows=1863 width=351) (actual time=52.502..10175.768 rows=267868 loops=1)

  • Buffers: shared hit=3450859
2. 437.597 5486.141 ↓ 143.8 267868 1

Hash Join (cost=130.63..32384.14 rows=1863 width=347) (actual time=52.468..5486.141 rows=267868 loops=1)

  • Hash Cond: (produto.cdgrupoproduto = grupoproduto.cdgrupoproduto)
  • Buffers: shared hit=1758488
3. 471.381 5048.449 ↓ 143.8 267868 1

Hash Join (cost=114.56..32342.45 rows=1863 width=129) (actual time=52.358..5048.449 rows=267868 loops=1)

  • Hash Cond: (lancamento.cdproduto = produto.cdproduto)
  • Buffers: shared hit=1758487
4. 1249.108 4570.525 ↓ 143.8 267868 1

Nested Loop (cost=0.00..32197.62 rows=1863 width=96) (actual time=45.792..4570.525 rows=267868 loops=1)

  • Buffers: shared hit=1758432
5. 1053.909 2219.705 ↓ 141.7 275428 1

Nested Loop (cost=0.00..25987.02 rows=1944 width=68) (actual time=45.774..2219.705 rows=275428 loops=1)

  • Buffers: shared hit=685510
6. 330.566 330.566 ↓ 141.4 167046 1

Seq Scan on lanccaixa (cost=0.00..17796.89 rows=1181 width=16) (actual time=45.741..330.566 rows=167046 loops=1)

  • Filter: ((cdempresa = 1) AND (cdoperacaocaixa = 1) AND (flcancelado = 0) AND (date(dhlanccaixa) >= '2011-05-01'::date) AND (date(dhlanccaixa) < '2012-03-21'::date))
  • Buffers: shared hit=10633
7. 835.230 835.230 ↑ 1.5 2 167046

Index Scan using ixlctocdlanccaixa on lancamento (cost=0.00..6.90 rows=3 width=64) (actual time=0.003..0.005 rows=2 loops=167046)

  • Index Cond: (cdlanccaixa = lanccaixa.cdlanccaixa)
  • Filter: (cdempresa = 1)
  • Buffers: shared hit=674877
8. 1101.712 1101.712 ↑ 1.0 1 275428

Index Scan using pkdocfiscalitem on docfiscalitem (cost=0.00..3.18 rows=1 width=40) (actual time=0.003..0.004 rows=1 loops=275428)

  • Index Cond: (cddocfiscalitem = lancamento.cddocfiscalitem)
  • Filter: (cdempresa = 1)
  • Buffers: shared hit=1072922
9. 3.864 6.543 ↑ 1.0 2647 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 175kB
  • Buffers: shared hit=55
10. 2.679 2.679 ↑ 1.0 2647 1

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

  • Buffers: shared hit=55
11. 0.055 0.095 ↑ 8.2 33 1

Hash (cost=12.70..12.70 rows=270 width=222) (actual time=0.095..0.095 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
  • Buffers: shared hit=1
12. 0.040 0.040 ↑ 8.2 33 1

Seq Scan on grupoproduto (cost=0.00..12.70 rows=270 width=222) (actual time=0.009..0.040 rows=33 loops=1)

  • Buffers: shared hit=1
13. 1339.340 1339.340 ↑ 1.0 1 267868

Index Scan using ixcustocdempdtcdp on custo (cost=0.00..6.99 rows=1 width=24) (actual time=0.004..0.005 rows=1 loops=267868)

  • Index Cond: ((date(lanccaixa.dhlanccaixa) = dtcusto) AND (lancamento.cdproduto = cdproduto) AND (cdempresa = 1) AND (cdempresa = lancamento.cdempresa))
  • Buffers: shared hit=1068428
14.          

SubPlan (forNested Loop Left Join)

15. 232.000 1682.000 ↑ 1.0 1 29000

Aggregate (cost=75.75..75.76 rows=1 width=16) (actual time=0.058..0.058 rows=1 loops=29000)

  • Buffers: shared hit=623943
16. 704.660 1450.000 ↑ 2.3 3 29000

Nested Loop (cost=0.00..75.72 rows=7 width=16) (actual time=0.013..0.050 rows=3 loops=29000)

  • Buffers: shared hit=623943
17. 203.000 203.000 ↑ 1.6 5 29000

Index Scan using ixlanccomposicaocdl on lanccomposicao (cost=0.00..8.41 rows=8 width=12) (actual time=0.003..0.007 rows=5 loops=29000)

  • Index Cond: (cdlancamento = lancamento.cdlancamento)
  • Buffers: shared hit=115116
18. 542.340 542.340 ↑ 1.0 1 135585

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

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