explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nh5b

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.072 2,141.465 ↑ 768.0 357 1

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

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

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

  • Workers Planned: 2
  • Workers Launched: 2
3. 67.933 2,094.161 ↑ 443.4 357 3 / 3

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

  • Group Key: (concat(atc4.codigo, '-', atc4.descripcion)), aec.id_grupo, atc4.codigo
4. 967.737 2,026.228 ↑ 1.2 130,160 3 / 3

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

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

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

6. 79.273 519.167 ↑ 1.2 130,160 3 / 3

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

7. 22.141 256.444 ↑ 1.2 3,669 3 / 3

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

8. 73.665 77.674 ↑ 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.028..77.674 rows=3,669 loops=3)

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

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

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

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

11. 111.730 126.927 ↑ 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.563..126.927 rows=31,844 loops=3)

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

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

  • Index Cond: (id_norma = 1)
13. 183.450 183.450 ↑ 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.022..0.05 rows=35 loops=11,007)

  • Index Cond: (id_episodio = ne.id)
  • Heap Fetches: 128537
14. 0.347 0.693 ↑ 1.0 768 3 / 3

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

15. 0.346 0.346 ↑ 1.0 768 3 / 3

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

Planning time : 3.777 ms
Execution time : 2,144.508 ms