explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HHpJ : Optimization for: Optimization for: Optimization for: plan #nh5b; plan #6bdP; plan #0br8

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.396 1,934.689 ↑ 768.0 357 1

Group (cost=57,263.69..98,842.51 rows=274,176 width=42) (actual time=1,706.974..1,934.689 rows=357 loops=1)

2. 51.453 1,934.293 ↑ 295.6 1,071 1

Gather Merge (cost=57,263.69..95,782.77 rows=316,574 width=42) (actual time=1,706.973..1,934.293 rows=1,071 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 74.144 1,882.840 ↑ 443.4 357 3 / 3

Group (cost=56,263.66..58,242.25 rows=158,287 width=42) (actual time=1,675.081..1,882.84 rows=357 loops=3)

4. 623.657 1,808.696 ↑ 1.2 130,160 3 / 3

Sort (cost=56,263.66..56,659.38 rows=158,287 width=42) (actual time=1,675.078..1,808.696 rows=130,160 loops=3)

  • Sort Key: aec.id_grupo, (concat(atc4.codigo, '-', atc4.descripcion)), atc4.codigo
  • Sort Method: external merge Disk: 7760kB
5. 606.551 1,185.039 ↑ 1.2 130,160 3 / 3

Hash Join (cost=13,310.19..37,721.85 rows=158,287 width=42) (actual time=180.979..1,185.039 rows=130,160 loops=3)

6. 106.421 577.415 ↑ 1.2 130,160 3 / 3

Nested Loop (cost=13,284.91..36,883.06 rows=158,287 width=4) (actual time=179.735..577.415 rows=130,160 loops=3)

7. 11.311 265.530 ↑ 1.2 3,669 3 / 3

Hash Join (cost=13,284.48..24,959.73 rows=4,402 width=8) (actual time=179.678..265.53 rows=3,669 loops=3)

8. 87.002 94.121 ↑ 1.2 3,669 3 / 3

Bitmap Heap Scan on episodios_cache_nf e (cost=679.29..12,149.74 rows=4,435 width=8) (actual time=19.462..94.121 rows=3,669 loops=3)

  • Filter: ((altad_normalizada >= 20180101) AND (altad_normalizada <= 20181231) AND (id_hospital = 290))
  • Heap Blocks: exact=3643
9. 7.119 7.119 ↓ 1.4 44,424 1 / 3

Bitmap Index Scan on norma_nf (cost=0..676.62 rows=31,494 width=0) (actual time=21.357..21.357 rows=44,424 loops=1)

  • Index Cond: (id_norma = 1)
10. 37.060 160.098 ↑ 1.0 31,844 3 / 3

Hash (cost=12,206.81..12,206.81 rows=31,871 width=4) (actual time=160.098..160.098 rows=31,844 loops=3)

11. 106.185 123.038 ↑ 1.0 31,844 3 / 3

Bitmap Heap Scan on episodios_cache_ne ne (cost=691.42..12,206.81 rows=31,871 width=4) (actual time=22.817..123.038 rows=31,844 loops=3)

  • Heap Blocks: exact=10983
12. 16.853 16.853 ↓ 1.4 43,863 3 / 3

Bitmap Index Scan on norma_ne (cost=0..683.45 rows=31,871 width=0) (actual time=16.853..16.853 rows=43,863 loops=3)

  • Index Cond: (id_norma = 1)
13. 205.464 205.464 ↑ 1.2 35 11,007 / 3

Index Scan using gfdfdggfd on atc_4_episodio_cache aec (cost=0.43..2.18 rows=42 width=8) (actual time=0.028..0.056 rows=35 loops=11,007)

  • Index Cond: (id_episodio = ne.id)
14. 0.545 1.073 ↑ 1.0 768 3 / 3

Hash (cost=15.68..15.68 rows=768 width=43) (actual time=1.073..1.073 rows=768 loops=3)

15. 0.528 0.528 ↑ 1.0 768 3 / 3

Seq Scan on atc_nivel_4 atc4 (cost=0..15.68 rows=768 width=43) (actual time=0.034..0.528 rows=768 loops=3)

Planning time : 4.171 ms
Execution time : 1,936.961 ms