explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wOeI

Settings
# exclusive inclusive rows x rows loops node
1. 353.048 26,857.268 ↑ 2.2 357 1

GroupAggregate (cost=330,579.28..330,721.63 rows=768 width=36) (actual time=26,414.909..26,857.268 rows=357 loops=1)

  • Group Key: atc_nivel_4.codigo, atc_nivel_4.codigo
2. 2,610.015 26,504.220 ↓ 43.5 390,479 1

Sort (cost=330,579.28..330,601.73 rows=8,978 width=20) (actual time=26,414.805..26,504.22 rows=390,479 loops=1)

  • Sort Key: atc_nivel_4.codigo
  • Sort Method: external sort Disk: 11464kB
3. 1,349.104 23,894.205 ↓ 43.5 390,479 1

Nested Loop (cost=313,863.3..329,989.78 rows=8,978 width=20) (actual time=10,122.983..23,894.205 rows=390,479 loops=1)

4. 985.881 13,466.957 ↓ 3,034.1 1,134,768 1

Hash Join (cost=313,862.88..329,676.3 rows=374 width=10) (actual time=10,122.91..13,466.957 rows=1,134,768 loops=1)

5. 724.042 12,480.651 ↓ 6.6 1,163,621 1

Unique (cost=313,837.6..327,015.45 rows=175,705 width=11) (actual time=10,122.473..12,480.651 rows=1,163,621 loops=1)

6. 9,862.752 11,756.609 ↓ 1.0 1,757,182 1

Sort (cost=313,837.6..318,230.22 rows=1,757,046 width=11) (actual time=10,122.471..11,756.609 rows=1,757,182 loops=1)

  • Sort Key: ("substring"((dc.atc)::text, 1, 5)), dc.id_episodio
  • Sort Method: external merge Disk: 48192kB
7. 1,893.857 1,893.857 ↓ 1.0 1,757,182 1

Seq Scan on dispensaciones_cache dc (cost=0..71,530.46 rows=1,757,046 width=11) (actual time=0.051..1,893.857 rows=1,757,182 loops=1)

8. 0.203 0.425 ↑ 1.0 768 1

Hash (cost=15.68..15.68 rows=768 width=6) (actual time=0.424..0.425 rows=768 loops=1)

9. 0.222 0.222 ↑ 1.0 768 1

Seq Scan on atc_nivel_4 atc_nivel_4 (cost=0..15.68 rows=768 width=6) (actual time=0.013..0.222 rows=768 loops=1)

10. 9,078.144 9,078.144 ↓ 0.0 0 1,134,768

Index Scan using id_nf on episodios_cache_nf e (cost=0.42..0.83 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1,134,768)

  • Index Cond: (id = dc.id_episodio)
  • Filter: ((altad_normalizada >= 20180101) AND (altad_normalizada <= 20181231) AND (id_hospital = 290) AND (id_norma = 1))
Planning time : 3.396 ms
Execution time : 26,871.736 ms