explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ld0

Settings
# exclusive inclusive rows x rows loops node
1. 64.434 46,343.798 ↑ 39.4 272 1

GroupAggregate (cost=2,242,363.15..2,242,872.06 rows=10,714 width=70) (actual time=46,272.936..46,343.798 rows=272 loops=1)

  • Group Key: a11.cod_causa_pago_directo_proc, a11.cod_centro_control, a11.cod_centro_medico_baja, a11.cod_clave_diagnostico_epis, a11.num_dias_it_total_proc, a13.cod_estructura, a13.cod_estr_niv3, a11.fec_inicio_proc, a11.id_hc, a11.cod_medico_control, a11 (...)
2. 304.289 46,279.364 ↓ 3.2 34,608 1

Sort (cost=2,242,363.15..2,242,389.93 rows=10,714 width=70) (actual time=46,272.871..46,279.364 rows=34,608 loops=1)

  • Sort Key: a11.cod_causa_pago_directo_proc, a11.cod_centro_control, a11.cod_centro_medico_baja, a11.cod_clave_diagnostico_epis, a11.num_dias_it_total_proc, a13.cod_estructura, a13.cod_estr_niv3, a11.fec_inicio_proc, a11.id_hc, a11.cod_medico_control (...)
  • Sort Method: quicksort Memory: 6403kB
3. 81.133 45,975.075 ↓ 3.2 34,608 1

Hash Join (cost=1,015,864.85..2,241,646.00 rows=10,714 width=70) (actual time=6,643.351..45,975.075 rows=34,608 loops=1)

  • Hash Cond: (a12.cod_centro_asignado = a13.cod_estr_niv3)
4. 126.213 45,841.939 ↓ 3.5 34,608 1

Nested Loop (cost=1,013,662.75..2,239,187.34 rows=9,961 width=65) (actual time=6,591.192..45,841.939 rows=34,608 loops=1)

5. 38,820.666 45,265.822 ↓ 3.5 34,608 1

Bitmap Heap Scan on fact_listado_asistencias a11 (cost=1,013,662.32..2,169,112.79 rows=9,961 width=66) (actual time=6,591.134..45,265.822 rows=34,608 loops=1)

  • Recheck Cond: ((cod_centro_control = '240'::numeric) AND (fec_fin_epi = '1899-12-31 00:00:00'::timestamp without time zone))
  • Rows Removed by Index Recheck: 13774512
  • Filter: ((cod_tipo_episodio = ANY ('{2,4}'::numeric[])) AND ((fec_fin_proc = to_date('1899-12-31'::text, 'YYYY-MM-DD'::text)) OR (cod_causa_alta = ANY ('{3,10,18,21,55}'::numeric[])) OR (fec_fin_proc > to_date('2019-03-13'::text, (...)
  • Rows Removed by Filter: 260370
  • Heap Blocks: exact=172174 lossy=1117197
6. 588.991 6,445.156 ↓ 0.0 0 1

BitmapAnd (cost=1,013,662.32..1,013,662.32 rows=411,747 width=0) (actual time=6,445.156..6,445.156 rows=0 loops=1)

7. 2,254.859 2,254.859 ↑ 1.0 2,503,877 1

Bitmap Index Scan on "INDI_FACT_LISTADO_ASISTENCIAS_19" (cost=0.00..285,172.39 rows=2,513,208 width=0) (actual time=2,254.859..2,254.859 rows=2,503,877 loops=1)

  • Index Cond: (cod_centro_control = '240'::numeric)
8. 3,601.306 3,601.306 ↑ 1.0 6,411,693 1

Bitmap Index Scan on "INDI_FACT_LISTADO_ASISTENCIAS_18" (cost=0.00..728,484.71 rows=6,420,177 width=0) (actual time=3,601.306..3,601.306 rows=6,411,693 loops=1)

  • Index Cond: (fec_fin_epi = '1899-12-31 00:00:00'::timestamp without time zone)
9. 449.904 449.904 ↑ 1.0 1 34,608

Index Scan using "IND_DIM_EMPRESA_EMP_actu2" on dim_empresa_actu a12 (cost=0.43..7.02 rows=1 width=11) (actual time=0.012..0.013 rows=1 loops=34,608)

  • Index Cond: (id_empresa = a11.id_empresa)
10. 8.965 52.003 ↑ 1.0 15,038 1

Hash (cost=2,012.38..2,012.38 rows=15,178 width=10) (actual time=52.003..52.003 rows=15,038 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 760kB
11. 43.038 43.038 ↑ 1.0 15,038 1

Seq Scan on dim_trs_estructura a13 (cost=0.00..2,012.38 rows=15,178 width=10) (actual time=15.970..43.038 rows=15,038 loops=1)

  • Filter: (cod_estructura = '2'::numeric)