explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ygfm

Settings
# exclusive inclusive rows x rows loops node
1. 0.097 14.341 ↓ 3.8 30 1

Sort (cost=1,262.67..1,262.69 rows=8 width=208) (actual time=14.338..14.341 rows=30 loops=1)

  • Sort Key: ei.ei_codigo DESC
  • Sort Method: quicksort Memory: 32kB
  • Buffers: shared hit=6217
2. 0.077 14.244 ↓ 3.8 30 1

Nested Loop (cost=240.79..1,262.55 rows=8 width=208) (actual time=2.854..14.244 rows=30 loops=1)

  • Buffers: shared hit=6217
3. 0.082 14.047 ↓ 3.8 30 1

Hash Join (cost=240.51..1,259.8 rows=8 width=181) (actual time=2.842..14.047 rows=30 loops=1)

  • Buffers: shared hit=6127
4. 0.620 13.917 ↓ 3.8 30 1

Nested Loop (cost=239.2..1,258.45 rows=8 width=103) (actual time=2.779..13.917 rows=30 loops=1)

  • Buffers: shared hit=6126
5. 1.043 11.487 ↓ 6.7 905 1

Nested Loop (cost=238.92..1,216.6 rows=135 width=107) (actual time=2.665..11.487 rows=905 loops=1)

  • Buffers: shared hit=3410
6. 3.763 8.634 ↓ 6.7 905 1

Hash Join (cost=238.63..1,171.93 rows=135 width=99) (actual time=2.633..8.634 rows=905 loops=1)

  • Buffers: shared hit=689
7. 2.457 2.457 ↑ 1.0 26,872 1

Seq Scan on entrega_itens ei (cost=0..862.72 rows=26,872 width=24) (actual time=0.199..2.457 rows=26,872 loops=1)

  • Buffers: shared hit=594
8. 0.060 2.414 ↓ 4.2 150 1

Hash (cost=238.18..238.18 rows=36 width=75) (actual time=2.414..2.414 rows=150 loops=1)

  • Buffers: shared hit=95
9. 2.354 2.354 ↓ 4.2 150 1

Seq Scan on entrega e (cost=0..238.18 rows=36 width=75) (actual time=0.019..2.354 rows=150 loops=1)

  • Filter: (((e.ent_datahora)::date >= '2019-07-01'::date) AND ((e.ent_datahora)::date <= '2019-08-31'::date))
  • Buffers: shared hit=95
10. 1.810 1.810 ↑ 1.0 1 905

Index Scan using pk_venda_itens on venda_itens vi (cost=0.29..0.33 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=905)

  • Index Cond: (vi.vi_codigo = ei.vi_codigo)
  • Buffers: shared hit=2721
11. 1.810 1.810 ↓ 0.0 0 905

Index Scan using pk_venda on venda v (cost=0.28..0.31 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=905)

  • Index Cond: ((v.ven_codigo = vi.ven_codigo) AND (v.emp_codigo = vi.emp_codigo))
  • Filter: (v.vds_codigo = 54)
  • Buffers: shared hit=2716
12. 0.014 0.048 ↑ 1.0 14 1

Hash (cost=1.14..1.14 rows=14 width=82) (actual time=0.048..0.048 rows=14 loops=1)

  • Buffers: shared hit=1
13. 0.034 0.034 ↑ 1.0 14 1

Seq Scan on usuario u (cost=0..1.14 rows=14 width=82) (actual time=0.031..0.034 rows=14 loops=1)

  • Buffers: shared hit=1
14. 0.120 0.120 ↑ 1.0 1 30

Index Scan using pk_cliente on cliente c (cost=0.27..0.34 rows=1 width=35) (actual time=0.004..0.004 rows=1 loops=30)

  • Index Cond: (c.cli_codigo = v.cli_codigo)
  • Buffers: shared hit=90