explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jZuE

Settings
# exclusive inclusive rows x rows loops node
1. 10.049 188,896.897 ↑ 1.0 1 1

Aggregate (cost=162,443.91..162,443.92 rows=1 width=32) (actual time=188,896.897..188,896.897 rows=1 loops=1)

2. 111,370.561 188,886.848 ↓ 32,941.0 32,941 1

Gather (cost=1,001.14..162,443.91 rows=1 width=6) (actual time=12,462.643..188,886.848 rows=32,941 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 287.422 77,516.287 ↓ 10,980.0 10,980 3 / 3

Nested Loop (cost=1.14..161,443.81 rows=1 width=6) (actual time=5,132.120..77,516.287 rows=10,980 loops=3)

4. 206.656 31,220.760 ↓ 830.5 1,022,402 3 / 3

Nested Loop (cost=0.57..158,355.81 rows=1,231 width=10) (actual time=51.179..31,220.760 rows=1,022,402 loops=3)

5. 51.678 51.678 ↑ 1.5 2 3 / 3

Parallel Seq Scan on produto (cost=0.00..12,849.97 rows=3 width=4) (actual time=50.829..51.678 rows=2 loops=3)

  • Filter: (pro_cd_produto_lmc = ANY ('{312,308,313,311,309,310}'::integer[]))
  • Rows Removed by Filter: 108261
6. 30,962.426 30,962.426 ↓ 10.1 511,201 6 / 3

Index Scan using venda_item_idx_produto_rebuild_1 on venda_item vei (cost=0.57..47,994.88 rows=50,707 width=14) (actual time=0.331..15,481.213 rows=511,201 loops=6)

  • Index Cond: (vei_cd_produto = produto.pro_cd_produto)
7. 46,008.105 46,008.105 ↓ 0.0 0 3,067,207 / 3

Index Scan using abastecimento_abt_cd_venda_item_key on abastecimento abt (cost=0.57..2.51 rows=1 width=4) (actual time=0.045..0.045 rows=0 loops=3,067,207)

  • Index Cond: (abt_cd_venda_item = vei.vei_cd_venda_item)
  • Filter: ((NOT abt_bl_afericao) AND (abt_cd_unidade_negocio = ANY ('{180,185}'::integer[])) AND (abt_dt_fiscal <= CURRENT_DATE) AND (abt_dt_fiscal >= (CURRENT_DATE - '30 days'::interval)))
  • Rows Removed by Filter: 1
Planning time : 4.709 ms
Execution time : 188,897.703 ms