explain.depesz.com

A tool for finding a real cause for slow queries.

Result: 35S

options
exclusive inclusive rows x rows loops node
0.222 285.462 ↓ 21.0 21 1

HashAggregate (cost=781.33..781.34 rows=1 width=120) (actual time=285.416..285.462 rows=21 loops=1)

0.149 285.240 ↓ 21.0 21 1

Nested Loop Left Join (cost=12.78..781.30 rows=1 width=120) (actual time=272.571..285.240 rows=21 loops=1)

0.142 284.902 ↓ 21.0 21 1

Nested Loop Left Join (cost=12.78..780.82 rows=1 width=120) (actual time=272.561..284.902 rows=21 loops=1)

0.163 284.634 ↓ 21.0 21 1

Nested Loop (cost=12.78..780.12 rows=1 width=120) (actual time=272.546..284.634 rows=21 loops=1)

0.162 284.177 ↓ 21.0 21 1

Nested Loop (cost=12.78..775.35 rows=1 width=120) (actual time=272.512..284.177 rows=21 loops=1)

39.255 283.847 ↓ 21.0 21 1

Nested Loop (cost=12.78..767.07 rows=1 width=120) (actual time=272.466..283.847 rows=21 loops=1)

20.266 118.952 ↓ 28.4 6282 1

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

0.056 0.157 ↑ 1.0 3 1

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

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

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

  • Index Cond: (id = ANY ('{35856,434915,23085}'::bigint[]))
98.529 98.529 ↓ 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.102..32.843 rows=2094 loops=3)

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

Index Scan using pk_venda on venda venda0_ (cost=0.00..1.03 rows=1 width=47) (actual time=0.020..0.020 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.168 0.168 ↑ 1.0 1 21

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

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

Index Scan using teste on pagamentovenda (cost=0.00..4.75 rows=1 width=16) (actual time=0.012..0.014 rows=1 loops=21)

  • Index Cond: (pagamentovenda.vendaid = venda0_.id)
0.126 0.126 ↓ 0.0 0 21

Index Scan using uidx_pagamentovendacrediario_pagamentovendaid on pagamentovendacrediario (cost=0.00..0.69 rows=1 width=16) (actual time=0.005..0.006 rows=0 loops=21)

  • Index Cond: (pagamentovendacrediario.pagamentovendaid = pagamentovenda.id)
0.189 0.189 ↓ 0.0 0 21

Index Scan using pk_cliente on cliente (cost=0.00..0.46 rows=1 width=16) (actual time=0.008..0.009 rows=0 loops=21)

  • Index Cond: (pagamentovendacrediario.clienteid = cliente.id)
  • Filter: (cliente.crediarioid <> ALL ('{122047,122048}'::bigint[]))