explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uLTf

Settings
# exclusive inclusive rows x rows loops node
1. 35.212 3,658.982 ↓ 13,273.0 13,273 1

GroupAggregate (cost=1,680.14..1,680.17 rows=1 width=40) (actual time=3,612.955..3,658.982 rows=13,273 loops=1)

  • Group Key: pa.cod_producto, pz.plazo_calc
2. 38.118 3,623.770 ↓ 13,273.0 13,273 1

Sort (cost=1,680.14..1,680.14 rows=1 width=16) (actual time=3,612.938..3,623.770 rows=13,273 loops=1)

  • Sort Key: pa.cod_producto, pz.plazo_calc
  • Sort Method: quicksort Memory: 775kB
3. 63.499 3,585.652 ↓ 13,273.0 13,273 1

Nested Loop (cost=28.41..1,680.13 rows=1 width=16) (actual time=2.579..3,585.652 rows=13,273 loops=1)

4. 83.262 1,305.562 ↓ 2,212.2 13,273 1

Nested Loop (cost=27.91..1,604.33 rows=6 width=20) (actual time=2.131..1,305.562 rows=13,273 loops=1)

5. 22.044 37.822 ↓ 11.8 13,773 1

Nested Loop (cost=27.49..456.35 rows=1,168 width=16) (actual time=1.763..37.822 rows=13,773 loops=1)

6. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on almacenes a (cost=0.00..1.32 rows=1 width=4) (actual time=0.014..0.019 rows=1 loops=1)

  • Filter: ((no_contabiliza)::text = 'N'::text)
  • Rows Removed by Filter: 25
7. 14.086 15.759 ↓ 9.5 13,773 1

Bitmap Heap Scan on productos_almacen pa (cost=27.49..440.57 rows=1,446 width=16) (actual time=1.744..15.759 rows=13,773 loops=1)

  • Recheck Cond: (cod_almacen = a.cod_almacen)
  • Heap Blocks: exact=381
8. 1.673 1.673 ↓ 9.5 13,775 1

Bitmap Index Scan on pa_ca_idx (cost=0.00..27.13 rows=1,446 width=0) (actual time=1.673..1.673 rows=13,775 loops=1)

  • Index Cond: (cod_almacen = a.cod_almacen)
9. 1,184.478 1,184.478 ↑ 1.0 1 13,773

Index Scan using productos_grupo_tarifas_pk on productos_grupo_tarifas pgt (cost=0.42..0.97 rows=1 width=8) (actual time=0.085..0.086 rows=1 loops=13,773)

  • Index Cond: ((cod_producto = pa.cod_producto) AND (cod_grupo_tarifas = ANY ('{1}'::integer[])))
  • Filter: (pa.cod_almacen = f_get_almacen(pa.cod_producto, '{1}'::integer[], cod_proveedor, 1))
10. 2,216.591 2,216.591 ↑ 5.0 1 13,273

Function Scan on f_plazo_prod_cache pz (cost=0.50..13.00 rows=5 width=8) (actual time=0.166..0.167 rows=1 loops=13,273)

  • Filter: (pa.cod_producto = cod_producto)