explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 1,547.860 ↑ 768.0 357 1

Group (cost=56,721.19..97,112.86 rows=274,176 width=36) (actual time=1,346.328..1,547.86 rows=357 loops=1)

  • Group Key: aec.id_grupo, (concat(atc4.codigo, '-', atc4.descripcion))
2. 103.455 1,550.307 ↑ 295.6 1,071 1

Gather Merge (cost=56,721.19..94,844.55 rows=316,574 width=36) (actual time=1,346.327..1,550.307 rows=1,071 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 42.038 1,446.852 ↑ 443.4 357 3 / 3

Group (cost=55,721.16..57,304.03 rows=158,287 width=36) (actual time=1,331.847..1,446.852 rows=357 loops=3)

  • Group Key: aec.id_grupo, (concat(atc4.codigo, '-', atc4.descripcion))
4. 412.381 1,404.814 ↑ 1.2 130,160 3 / 3

Sort (cost=55,721.16..56,116.88 rows=158,287 width=36) (actual time=1,331.844..1,404.814 rows=130,160 loops=3)

  • Sort Key: aec.id_grupo, (concat(atc4.codigo, '-', atc4.descripcion))
  • Sort Method: external merge Disk: 6,648kB
5. 457.969 992.433 ↑ 1.2 130,160 3 / 3

Hash Join (cost=13,310.19..37,721.85 rows=158,287 width=36) (actual time=148.624..992.433 rows=130,160 loops=3)

6. 85.129 533.703 ↑ 1.2 130,160 3 / 3

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

7. 13.949 254.117 ↑ 1.2 3,669 3 / 3

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

8. 106.161 111.338 ↑ 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=18.785..111.338 rows=3,669 loops=3)

  • Filter: ((altad_normalizada >= 20,180,101) AND (altad_normalizada <= 20,181,231) AND (id_hospital = 290))
  • Heap Blocks: exact=3,566
9. 5.177 5.177 ↓ 1.4 44,424 1 / 3

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

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

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

11. 94.721 108.618 ↑ 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=20.432..108.618 rows=31,844 loops=3)

  • Heap Blocks: exact=10,983
12. 13.897 13.897 ↓ 1.4 43,863 3 / 3

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

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

Index Only Scan using atc_4_episodio_cache_pkey on atc_4_episodio_cache aec (cost=0.43..2.18 rows=42 width=8) (actual time=0.026..0.053 rows=35 loops=11,007)

  • Index Cond: (id_episodio = ne.id)
  • Heap Fetches: 123,445
14. 0.316 0.761 ↑ 1.0 768 3 / 3

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

15. 0.445 0.445 ↑ 1.0 768 3 / 3

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

Planning time : 3.726 ms
Execution time : 1,553.45 ms