explain.depesz.com

A tool for finding a real cause for slow queries.

Result: In8J

options
exclusive inclusive rows x rows loops node
0.502 17713.530 ↓ 21.0 21 1

HashAggregate (cost=9089.38..9089.40 rows=1 width=97) (actual time=17713.486..17713.530 rows=21 loops=1)

175.470 17713.028 ↓ 21.0 21 1

Nested Loop Anti Join (cost=1171.48..9089.36 rows=1 width=97) (actual time=1286.851..17713.028 rows=21 loops=1)

  • Join Filter: (pagamentov6_.vendaid = venda0_.id)
0.189 316.025 ↓ 21.0 21 1

Nested Loop Left Join (cost=12.78..970.99 rows=1 width=97) (actual time=305.566..316.025 rows=21 loops=1)

0.210 315.437 ↓ 21.0 21 1

Nested Loop (cost=12.78..964.64 rows=1 width=97) (actual time=305.526..315.437 rows=21 loops=1)

35.357 314.996 ↓ 21.0 21 1

Nested Loop (cost=12.78..956.36 rows=1 width=97) (actual time=305.506..314.996 rows=21 loops=1)

21.228 147.717 ↓ 28.4 6282 1

Nested Loop (cost=12.78..536.26 rows=221 width=73) (actual time=2.142..147.717 rows=6282 loops=1)

0.059 0.150 ↑ 1.0 3 1

Bitmap Heap Scan on embalagem embalagem2_ (cost=12.78..23.92 rows=3 width=44) (actual time=0.119..0.150 rows=3 loops=1)

  • Recheck Cond: (id = ANY ('{35856,434915,23085}'::bigint[]))
0.091 0.091 ↑ 1.0 3 1

Bitmap Index Scan on pk_embalagem (cost=0.00..12.78 rows=3 width=0) (actual time=0.091..0.091 rows=3 loops=1)

  • Index Cond: (id = ANY ('{35856,434915,23085}'::bigint[]))
126.339 126.339 ↓ 28.3 2094 3

Index Scan using idx_itemvenda_status_embalagemid on itemvenda itens1_ (cost=0.00..169.85 rows=74 width=37) (actual time=0.732..42.113 rows=2094 loops=3)

  • Index Cond: ((itens1_.status = 'F'::bpchar) AND (itens1_.embalagemid = embalagem2_.id))
131.922 131.922 ↓ 0.0 0 6282

Index Scan using pk_venda on venda venda0_ (cost=0.00..1.89 rows=1 width=32) (actual time=0.021..0.021 rows=0 loops=6282)

  • Index Cond: (venda0_.id = itens1_.vendaid)
  • Filter: ((venda0_.datahorafechamento >= '2012-01-06 00:00:00'::timestamp without time zone) AND (venda0_.datahorafechamento <= '2012-01-06 23:59:59'::timestamp without time zone) AND (venda0_.unidadenegocioid = ANY ('{1,563794,563795}'::bigint[])) AND ((venda0_.status = 'F'::bpchar) OR (venda0_.status = 'D'::bpchar)))
0.231 0.231 ↑ 1.0 1 21

Index Scan using pk_produto on produto produto3_ (cost=0.00..8.27 rows=1 width=8) (actual time=0.008..0.011 rows=1 loops=21)

  • Index Cond: (produto3_.id = embalagem2_.produtoid)
0.399 0.399 ↑ 1.0 1 21

Index Scan using pk_orcamento on orcamento orcamento4_ (cost=0.00..6.34 rows=1 width=8) (actual time=0.016..0.019 rows=1 loops=21)

  • Index Cond: (venda0_.orcamentoid = orcamento4_.id)
8287.803 17221.533 ↓ 4.6 5980 21

Hash Join (cost=1158.70..8102.28 rows=1287 width=8) (actual time=7.634..820.073 rows=5980 loops=21)

  • Hash Cond: (pagamentov6_.id = pagamentov5_.pagamentovendaid)
8774.514 8774.514 ↓ 1.0 253786 21

Seq Scan on pagamentovenda pagamentov6_ (cost=0.00..5979.61 rows=253626 width=16) (actual time=0.029..417.834 rows=253786 loops=21)

  • Filter: (status = 'F'::bpchar)
9.629 159.216 ↓ 4.7 6038 1

Hash (cost=1142.61..1142.61 rows=1287 width=8) (actual time=159.216..159.216 rows=6038 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 189kB
67.608 149.587 ↓ 4.7 6038 1

Hash Join (cost=190.61..1142.61 rows=1287 width=8) (actual time=16.288..149.587 rows=6038 loops=1)

  • Hash Cond: (pagamentov5_.clienteid = cliente7_.id)
65.739 65.739 ↑ 1.0 42482 1

Seq Scan on pagamentovendacrediario pagamentov5_ (cost=0.00..779.82 rows=42482 width=16) (actual time=0.026..65.739 rows=42482 loops=1)

0.543 16.240 ↑ 1.8 88 1

Hash (cost=188.63..188.63 rows=159 width=8) (actual time=16.240..16.240 rows=88 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
7.212 15.697 ↑ 1.8 88 1

Hash Join (cost=2.86..188.63 rows=159 width=8) (actual time=0.129..15.697 rows=88 loops=1)

  • Hash Cond: (cliente7_.crediarioid = crediario8_.id)
8.418 8.418 ↑ 1.0 5249 1

Seq Scan on cliente cliente7_ (cost=0.00..164.49 rows=5249 width=16) (actual time=0.021..8.418 rows=5249 loops=1)

0.009 0.067 ↑ 1.0 2 1

Hash (cost=2.84..2.84 rows=2 width=8) (actual time=0.067..0.067 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
0.058 0.058 ↑ 1.0 2 1

Seq Scan on crediario crediario8_ (cost=0.00..2.84 rows=2 width=8) (actual time=0.027..0.058 rows=2 loops=1)

  • Filter: (id = ANY ('{122047,122048}'::bigint[]))