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. 1,668.287 10,175.768 ↓ 143.8 267,868 1

Nested Loop Left Join (cost=130.63..186,614.60 rows=1,863 width=351) (actual time=52.502..10,175.768 rows=267,868 loops=1)

  • Buffers: shared hit=3450859
2. 437.597 5,486.141 ↓ 143.8 267,868 1

Hash Join (cost=130.63..32,384.14 rows=1,863 width=347) (actual time=52.468..5,486.141 rows=267,868 loops=1)

  • Hash Cond: (produto.cdgrupoproduto = grupoproduto.cdgrupoproduto)
  • Buffers: shared hit=1758488
3. 471.381 5,048.449 ↓ 143.8 267,868 1

Hash Join (cost=114.56..32,342.45 rows=1,863 width=129) (actual time=52.358..5,048.449 rows=267,868 loops=1)

  • Hash Cond: (lancamento.cdproduto = produto.cdproduto)
  • Buffers: shared hit=1758487
4. 1,249.108 4,570.525 ↓ 143.8 267,868 1

Nested Loop (cost=0.00..32,197.62 rows=1,863 width=96) (actual time=45.792..4,570.525 rows=267,868 loops=1)

  • Buffers: shared hit=1758432
5. 1,053.909 2,219.705 ↓ 141.7 275,428 1

Nested Loop (cost=0.00..25,987.02 rows=1,944 width=68) (actual time=45.774..2,219.705 rows=275,428 loops=1)

  • Buffers: shared hit=685510
6. 330.566 330.566 ↓ 141.4 167,046 1

Seq Scan on lanccaixa (cost=0.00..17,796.89 rows=1,181 width=16) (actual time=45.741..330.566 rows=167,046 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 167,046

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

  • Index Cond: (cdlanccaixa = lanccaixa.cdlanccaixa)
  • Filter: (cdempresa = 1)
  • Buffers: shared hit=674877
8. 1,101.712 1,101.712 ↑ 1.0 1 275,428

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

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

Hash (cost=81.47..81.47 rows=2,647 width=33) (actual time=6.543..6.543 rows=2,647 loops=1)

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

Seq Scan on produto (cost=0.00..81.47 rows=2,647 width=33) (actual time=0.006..2.679 rows=2,647 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. 1,339.340 1,339.340 ↑ 1.0 1 267,868

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

  • 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 1,682.000 ↑ 1.0 1 29,000

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

  • Buffers: shared hit=623943
16. 704.660 1,450.000 ↑ 2.3 3 29,000

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

  • Buffers: shared hit=623943
17. 203.000 203.000 ↑ 1.6 5 29,000

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

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

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

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