explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ddFj

Settings
# exclusive inclusive rows x rows loops node
1. 143.944 266,096.227 ↑ 1.0 1 1

Nested Loop (cost=9,952.39..11,387.08 rows=1 width=36) (actual time=167,921.977..266,096.227 rows=1 loops=1)

  • Join Filter: ((pedite.cd_empresa = ponteped.cd_empresa) AND (pedite.cd_base = ponteped.cd_base) AND (pedite.seq_pedido = ponteped.seq_pedido))
  • Rows Removed by Join Filter: 31202
2. 279.089 13,644.825 ↓ 31,203.0 31,203 1

Nested Loop (cost=9,952.39..9,968.50 rows=1 width=97) (actual time=523.591..13,644.825 rows=31,203 loops=1)

  • Join Filter: ((pedite.seq_item)::numeric = (itemzim.seqpedido)::numeric)
  • Rows Removed by Join Filter: 82372
3. 284.190 12,002.836 ↓ 113,575.0 113,575 1

Nested Loop (cost=9,951.97..9,960.03 rows=1 width=92) (actual time=521.053..12,002.836 rows=113,575 loops=1)

4. 414.881 701.871 ↓ 113,575.0 113,575 1

HashAggregate (cost=9,951.55..9,951.56 rows=1 width=37) (actual time=447.750..701.871 rows=113,575 loops=1)

  • Group Key: fat.cd_empresa, fat.cd_base, fat.seq_pedido, fat.seq_item
5. 73.113 286.990 ↓ 136,640.0 136,640 1

Hash Anti Join (cost=5,352.92..9,951.54 rows=1 width=37) (actual time=118.267..286.990 rows=136,640 loops=1)

  • Hash Cond: ((fat.cd_empresa = procan.cd_empresa) AND (fat.cd_base_doc = procan.cd_base) AND (fat.seq_processo_doc = procan.seq_processo))
6. 97.395 97.395 ↑ 1.0 136,644 1

Seq Scan on pedido_item_fat fat (cost=0.00..3,060.35 rows=136,735 width=53) (actual time=0.580..97.395 rows=136,644 loops=1)

7. 63.212 116.482 ↓ 1.0 133,091 1

Hash (cost=3,023.88..3,023.88 rows=133,088 width=24) (actual time=116.482..116.482 rows=133,091 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9327kB
8. 53.270 53.270 ↓ 1.0 133,091 1

Seq Scan on processo_canc procan (cost=0.00..3,023.88 rows=133,088 width=24) (actual time=0.038..53.270 rows=133,091 loops=1)

9. 11,016.775 11,016.775 ↑ 1.0 1 113,575

Index Scan using pedido_item_pk on pedido_item pedite (cost=0.42..8.45 rows=1 width=36) (actual time=0.097..0.097 rows=1 loops=113,575)

  • Index Cond: ((cd_empresa = fat.cd_empresa) AND (cd_base = fat.cd_base) AND (seq_pedido = fat.seq_pedido) AND (seq_item = fat.seq_item))
10. 1,362.900 1,362.900 ↑ 1.0 1 113,575

Index Only Scan using compra_e_itempedcom_pk on compra_e_itempedcom itemzim (cost=0.42..8.45 rows=1 width=16) (actual time=0.011..0.012 rows=1 loops=113,575)

  • Index Cond: ((cdfilialent = '57'::bpchar) AND (nrpedido = '152257'::bpchar) AND (nrparcde = 'XX'::bpchar) AND (seqpedido = ' 1'::bpchar))
  • Heap Fetches: 113575
11. 252,307.458 252,307.458 ↑ 1.0 1 31,203

Seq Scan on pedido_ponte ponteped (cost=0.00..1,418.56 rows=1 width=36) (actual time=7.834..8.086 rows=1 loops=31,203)

  • Filter: (((cdfilialent_zim)::bpchar = '57'::bpchar) AND ((nrpedido_zim)::bpchar = '152257'::bpchar) AND ((nrparcde_zim)::bpchar = 'XX'::bpchar) AND ((id_tipo_pedido)::text = 'COE'::text))
  • Rows Removed by Filter: 47710