explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K9SO

Settings
# exclusive inclusive rows x rows loops node
1. 16.044 932.200 ↓ 2.6 530 1

GroupAggregate (cost=111,585.24..111,788.44 rows=200 width=132) (actual time=914.496..932.2 rows=530 loops=1)

  • Group Key: a.atc, a.metrica_codigo
2. 22.392 916.156 ↓ 1.3 11,130 1

Sort (cost=111,585.24..111,607.32 rows=8,831 width=54) (actual time=914.451..916.156 rows=11,130 loops=1)

  • Sort Key: a.atc, a.metrica_codigo
  • Sort Method: quicksort Memory: 1949kB
3. 34.556 893.764 ↓ 1.3 11,130 1

Hash Join (cost=109,687.15..111,006.44 rows=8,831 width=54) (actual time=853.319..893.764 rows=11,130 loops=1)

4. 0.703 676.061 ↓ 1.3 2,226 1

Subquery Scan on a (cost=95,282.7..95,488.66 rows=1,766 width=36) (actual time=669.912..676.061 rows=2,226 loops=1)

5. 1.158 675.358 ↓ 1.3 2,226 1

Group (cost=95,282.7..95,471 rows=1,766 width=36) (actual time=669.911..675.358 rows=2,226 loops=1)

  • Group Key: e_1.id, d.atc, d.atc_descripcion
6. 17.828 674.200 ↓ 1.7 2,574 1

Gather Merge (cost=95,282.7..95,459.96 rows=1,472 width=36) (actual time=669.908..674.2 rows=2,574 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 0.524 656.372 ↓ 1.2 858 3 / 3

Group (cost=94,282.68..94,290.04 rows=736 width=36) (actual time=655.693..656.372 rows=858 loops=3)

  • Group Key: e_1.id, d.atc, d.atc_descripcion
8. 2.508 655.848 ↓ 1.3 966 3 / 3

Sort (cost=94,282.68..94,284.52 rows=736 width=36) (actual time=655.69..655.848 rows=966 loops=3)

  • Sort Key: e_1.id, d.atc, d.atc_descripcion
  • Sort Method: quicksort Memory: 140kB
9. 299.279 653.340 ↓ 1.3 966 3 / 3

Hash Join (cost=13,012.43..94,247.63 rows=736 width=36) (actual time=58.249..653.34 rows=966 loops=3)

10. 296.831 296.831 ↑ 1.2 585,727 3 / 3

Seq Scan on dispensaciones_cache d (cost=0..53,772.44 rows=732,144 width=36) (actual time=0.82..296.831 rows=585,727 loops=3)

11. 0.075 57.230 ↓ 1.5 48 3 / 3

Hash (cost=13,012.03..13,012.03 rows=32 width=4) (actual time=57.23..57.23 rows=48 loops=3)

12. 35.760 57.155 ↓ 1.5 48 3 / 3

Bitmap Heap Scan on episodios_cache_nf e_1 (cost=2,458.72..13,012.03 rows=32 width=4) (actual time=27.467..57.155 rows=48 loops=3)

  • Filter: ((grd)::text = '002'::text)
  • Heap Blocks: exact=7796
13. 21.395 21.395 ↓ 1.3 13,619 3 / 3

Bitmap Index Scan on hospital_norma_nf (cost=0..2,458.71 rows=10,644 width=0) (actual time=21.394..21.395 rows=13,619 loops=3)

  • Index Cond: ((id_hospital = 290) AND (altad_normalizada >= 20180101) AND (altad_normalizada <= 20181231) AND (id_norma = 1))
14. 69.140 183.147 ↑ 1.0 159,220 1

Hash (cost=11,481.2..11,481.2 rows=159,220 width=18) (actual time=183.147..183.147 rows=159,220 loops=1)

15. 114.007 114.007 ↑ 1.0 159,220 1

Seq Scan on episodios_cache_nf e (cost=0..11,481.2 rows=159,220 width=18) (actual time=0.012..114.007 rows=159,220 loops=1)

Planning time : 0.99 ms
Execution time : 932.586 ms