explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QRhV : nfce

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 0.605 ↓ 22.5 45 1

Limit (cost=8.55..8.63 rows=2 width=761) (actual time=0.56..0.605 rows=45 loops=1)

  • Buffers: shared hit=373 read=3
2. 0.045 0.602 ↓ 22.5 45 1

Aggregate (cost=8.55..8.63 rows=2 width=761) (actual time=0.559..0.602 rows=45 loops=1)

  • Buffers: shared hit=373 read=3
3. 0.117 0.557 ↓ 36.0 72 1

Sort (cost=8.55..8.55 rows=2 width=704) (actual time=0.553..0.557 rows=72 loops=1)

  • Sort Key: documentoeletronicoven.dt_cadastro DESC, documentoeletronicoven.nr_documento DESC, documentoeletronicoven.nr_serie, documentoeletronicochaveven.tx_chave, documentoeletronicoven.cd_status, documentoeletronicoeventoven.cd_situacao, documentoeletronicoeventoven.tx_motivo, vendapdv.id_vendapdv, integracaovendaven.fl_integrado
  • Sort Method: quicksort Memory: 44kB
  • Buffers: shared hit=373 read=3
4. 0.031 0.440 ↓ 36.0 72 1

Hash Join (cost=5.3..8.54 rows=2 width=704) (actual time=0.408..0.44 rows=72 loops=1)

  • Buffers: shared hit=373 read=3
5. 0.033 0.033 ↑ 1.0 89 1

Seq Scan on tb_vendaitempdv vendaitempdv (cost=0..2.89 rows=89 width=12) (actual time=0.022..0.033 rows=89 loops=1)

  • Buffers: shared hit=2
6. 0.021 0.376 ↓ 45.0 45 1

Hash (cost=5.28..5.28 rows=1 width=737) (actual time=0.376..0.376 rows=45 loops=1)

  • Buffers: shared hit=371 read=3
7. 0.019 0.355 ↓ 45.0 45 1

Nested Loop (cost=2.42..5.28 rows=1 width=737) (actual time=0.12..0.355 rows=45 loops=1)

  • Buffers: shared hit=371 read=3
8. 0.019 0.291 ↓ 45.0 45 1

Nested Loop (cost=2.28..4.86 rows=1 width=691) (actual time=0.105..0.291 rows=45 loops=1)

  • Buffers: shared hit=282 read=2
9. 0.014 0.225 ↓ 47.0 47 1

Nested Loop (cost=2.14..4.43 rows=1 width=682) (actual time=0.089..0.225 rows=47 loops=1)

  • Buffers: shared hit=188 read=2
10. 0.032 0.164 ↓ 47.0 47 1

Nested Loop (cost=2..4 rows=1 width=654) (actual time=0.076..0.164 rows=47 loops=1)

  • Buffers: shared hit=95 read=1
11. 0.036 0.085 ↓ 47.0 47 1

Hash Join (cost=1.86..3.58 rows=1 width=614) (actual time=0.05..0.085 rows=47 loops=1)

  • Buffers: shared hit=2
12. 0.010 0.010 ↑ 1.0 47 1

Seq Scan on tb_documentoeletrven documentoeletronicoven (cost=0..1.47 rows=47 width=66) (actual time=0.007..0.01 rows=47 loops=1)

  • Buffers: shared hit=1
13. 0.016 0.039 ↓ 15.7 47 1

Hash (cost=1.82..1.82 rows=3 width=560) (actual time=0.039..0.039 rows=47 loops=1)

  • Buffers: shared hit=1
14. 0.023 0.023 ↓ 15.7 47 1

Seq Scan on tb_documentoeletreventoven documentoeletronicoeventoven (cost=0..1.82 rows=3 width=560) (actual time=0.009..0.023 rows=47 loops=1)

  • Filter: ((documentoeletronicoeventoven.cd_evento = '2'::numeric) OR (documentoeletronicoeventoven.cd_evento = '3'::numeric) OR (documentoeletronicoeventoven.cd_evento = '1'::numeric))
  • Buffers: shared hit=1
15. 0.047 0.047 ↑ 1.0 1 47

Index Scan using documentoeletrvendaven_pk on tb_documentoeletrvendaven documentoeletronicovendaven (cost=0.14..0.41 rows=1 width=40) (actual time=0.001..0.001 rows=1 loops=47)

  • Index Cond: (documentoeletronicovendaven.cd_documentoeletrven = documentoeletronicoven.id_documentoeletrven)
  • Buffers: shared hit=93 read=1
16. 0.047 0.047 ↑ 1.0 1 47

Index Scan using integracaovendaven_pk on tb_integracaovendaven integracaovendaven (cost=0.14..0.41 rows=1 width=28) (actual time=0.001..0.001 rows=1 loops=47)

  • Index Cond: (integracaovendaven.cd_vendapdv = documentoeletronicovendaven.cd_vendaven)
  • Buffers: shared hit=93 read=1
17. 0.047 0.047 ↑ 1.0 1 47

Index Scan using vendapdv_pk on tb_vendapdv vendapdv (cost=0.14..0.42 rows=1 width=9) (actual time=0.001..0.001 rows=1 loops=47)

  • Index Cond: (vendapdv.id_vendapdv = documentoeletronicovendaven.cd_vendaven)
  • Filter: ((vendapdv.dt_movimento >= '2019-11-22'::date) AND (vendapdv.dt_movimento <= '2019-11-27'::date) AND (vendapdv.cd_pdv = '1'::numeric) AND (vendapdv.cd_empresa = '1'::numeric))
  • Buffers: shared hit=94
18. 0.045 0.045 ↑ 1.0 1 45

Index Scan using documentoeletrchaveven_pk on tb_documentoeletrchaveven documentoeletronicochaveven (cost=0.14..0.41 rows=1 width=126) (actual time=0.001..0.001 rows=1 loops=45)

  • Index Cond: (documentoeletronicochaveven.cd_documentoeletrven = documentoeletronicovendaven.cd_documentoeletrven)
  • Buffers: shared hit=89 read=1
Planning time : 16.574 ms
Execution time : 0.765 ms