explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3JxO

Settings
# exclusive inclusive rows x rows loops node
1. 0.047 139.464 ↑ 8.0 4 1

GroupAggregate (cost=22,331.06..22,333.30 rows=32 width=462) (actual time=139.447..139.464 rows=4 loops=1)

  • Group Key: a.grupo, a.id_grupo
2. 0.022 139.417 ↑ 4.0 8 1

Sort (cost=22,331.06..22,331.14 rows=32 width=390) (actual time=139.416..139.417 rows=8 loops=1)

  • Sort Key: a.grupo, a.id_grupo
  • Sort Method: quicksort Memory: 26kB
3. 0.006 139.395 ↑ 4.0 8 1

Subquery Scan on a (cost=12,285.72..22,330.26 rows=32 width=390) (actual time=119.117..139.395 rows=8 loops=1)

4. 0.003 139.389 ↑ 4.0 8 1

Append (cost=12,285.72..22,329.94 rows=32 width=390) (actual time=119.116..139.389 rows=8 loops=1)

5. 0.004 119.153 ↑ 4.0 4 1

Subquery Scan on *SELECT* 1 (cost=12,285.72..12,287.68 rows=16 width=181) (actual time=119.115..119.153 rows=4 loops=1)

6. 0.068 119.149 ↑ 4.0 4 1

Finalize GroupAggregate (cost=12,285.72..12,287.48 rows=16 width=181) (actual time=119.113..119.149 rows=4 loops=1)

  • Group Key: e.sexo, e.id_sexo
7. 0.000 119.081 ↑ 2.7 12 1

Sort (cost=12,285.72..12,285.80 rows=32 width=241) (actual time=119.079..119.081 rows=12 loops=1)

  • Sort Key: e.sexo, e.id_sexo
  • Sort Method: quicksort Memory: 31kB
8. 9.443 119.149 ↑ 2.7 12 1

Gather (cost=12,281.52..12,284.92 rows=32 width=241) (actual time=114.266..119.149 rows=12 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 33.923 109.706 ↑ 4.0 4 3

Partial HashAggregate (cost=11,281.52..11,281.72 rows=16 width=241) (actual time=109.700..109.706 rows=4 loops=3)

  • Group Key: e.sexo, e.id_sexo
10. 75.783 75.783 ↑ 1.2 3,669 3

Parallel Seq Scan on episodios_cache_nf e (cost=0.00..11,079.83 rows=4,482 width=51) (actual time=0.042..75.783 rows=3,669 loops=3)

  • Filter: ((altad_normalizada >= 20180101) AND (altad_normalizada <= 20181231) AND (id_hospital = 290) AND (id_norma = 1))
  • Rows Removed by Filter: 49404
11. 0.094 20.233 ↑ 4.0 4 1

Subquery Scan on *SELECT* 2 (cost=10,041.57..10,042.25 rows=16 width=181) (actual time=20.229..20.233 rows=4 loops=1)

12. 0.021 20.139 ↑ 4.0 4 1

Sort (cost=10,041.57..10,041.61 rows=16 width=129) (actual time=20.138..20.139 rows=4 loops=1)

  • Sort Key: e_1.sexo
  • Sort Method: quicksort Memory: 25kB
13. 5.363 20.118 ↑ 4.0 4 1

HashAggregate (cost=10,041.09..10,041.25 rows=16 width=129) (actual time=20.115..20.118 rows=4 loops=1)

  • Group Key: e_1.sexo, e_1.id_sexo
14. 14.755 14.755 ↓ 1.1 6,581 1

Index Scan using hospital_norma_nf on episodios_cache_nf e_1 (cost=0.42..9,994.23 rows=6,248 width=17) (actual time=0.033..14.755 rows=6,581 loops=1)

  • Index Cond: ((id_hospital = 290) AND (altad_normalizada >= 20170101) AND (altad_normalizada <= 20171231) AND (id_norma = 1))
Planning time : 1.402 ms
Execution time : 139.926 ms