explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T0CX : Optimization for: plan #XvSw

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 102.535 ↓ 1.3 2,226 1

Group (cost=82,570.27..82,758.57 rows=1,766 width=380) (actual time=96.563..102.535 rows=2,226 loops=1)

  • Group Key: e.id, d.atc, d.atc_descripcion
2. 18.832 107.291 ↓ 1.5 2,226 1

Gather Merge (cost=82,570.27..82,747.53 rows=1,472 width=380) (actual time=96.561..107.291 rows=2,226 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.469 88.459 ↓ 1.0 742 3 / 3

Group (cost=81,570.24..81,577.6 rows=736 width=380) (actual time=87.869..88.459 rows=742 loops=3)

  • Group Key: e.id, d.atc, d.atc_descripcion
4. 2.988 87.990 ↓ 1.3 966 3 / 3

Sort (cost=81,570.24..81,572.08 rows=736 width=380) (actual time=87.868..87.99 rows=966 loops=3)

  • Sort Key: e.id, d.atc, d.atc_descripcion
  • Sort Method: quicksort Memory: 76kB
5. 0.657 85.002 ↓ 1.3 966 3 / 3

Nested Loop (cost=160.89..81,535.2 rows=736 width=380) (actual time=7.959..85.002 rows=966 loops=3)

6. 72.217 72.217 ↓ 1.2 16 3 / 3

Seq Scan on episodios_cache_nf e (cost=0..11,381.69 rows=13 width=4) (actual time=7.849..72.217 rows=16 loops=3)

  • Filter: ((altad_normalizada >= 20180101) AND (altad_normalizada <= 20181231) AND (id_hospital = 290) AND (id_norma = 1) AND ((grd)::text = '002'::text))
7. 11.424 12.128 ↑ 146.4 60 48 / 3

Bitmap Heap Scan on dispensaciones_cache d (cost=160.89..5,308.56 rows=8,786 width=380) (actual time=0.073..0.758 rows=60 loops=48)

  • Heap Blocks: exact=565
8. 0.704 0.704 ↑ 146.4 60 48 / 3

Bitmap Index Scan on dispensacion_episodio (cost=0..158.7 rows=8,786 width=0) (actual time=0.044..0.044 rows=60 loops=48)

  • Index Cond: (id_episodio = e.id)
Planning time : 1.03 ms
Execution time : 108.808 ms