explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HdEv

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 106.518 ↓ 2.8 11 1

Sort (cost=1,892.36..1,892.37 rows=4 width=202) (actual time=106.513..106.518 rows=11 loops=1)

  • Sort Key: a.ini_agen
  • Sort Method: quicksort Memory: 27kB
2. 0.177 106.436 ↓ 2.8 11 1

Nested Loop Left Join (cost=559.07..1,892.32 rows=4 width=202) (actual time=22.284..106.436 rows=11 loops=1)

  • Join Filter: ((m.rut_med)::double precision = a.rut_med)
3. 0.036 91.849 ↓ 11.0 11 1

Nested Loop Left Join (cost=559.07..1,820.58 rows=1 width=165) (actual time=21.720..91.849 rows=11 loops=1)

4. 1.725 91.681 ↓ 11.0 11 1

Nested Loop Left Join (cost=558.65..1,812.13 rows=1 width=157) (actual time=21.697..91.681 rows=11 loops=1)

  • Join Filter: (a.cod_agen = (b.scupo)::double precision)
  • Rows Removed by Join Filter: 9470
5. 0.215 74.380 ↓ 11.0 11 1

Nested Loop (cost=317.31..1,556.54 rows=1 width=149) (actual time=8.371..74.380 rows=11 loops=1)

  • Join Filter: (((a.ini_agen)::time without time zone >= (h.hora_inicio)::time without time zone) AND ((a.ini_agen)::time without time zone <= (h.hora_fin)::time without time zone))
  • Rows Removed by Join Filter: 11
6. 0.033 0.377 ↓ 11.0 11 1

Nested Loop Left Join (cost=0.86..16.92 rows=1 width=145) (actual time=0.054..0.377 rows=11 loops=1)

7. 0.113 0.113 ↓ 11.0 11 1

Index Scan using agenda_idx_rut_med_fec_agen on agenda a (cost=0.43..8.46 rows=1 width=120) (actual time=0.035..0.113 rows=11 loops=1)

  • Index Cond: ((rut_med = '16276021'::double precision) AND (fec_agen = '2019-07-10 00:00:00'::timestamp without time zone))
  • Filter: ((cod_sala = '256'::double precision) AND (est_agen = '1'::double precision) AND (scupo = 0))
  • Rows Removed by Filter: 7
8. 0.231 0.231 ↑ 1.0 1 11

Index Scan using paciente_pkey on paciente p (cost=0.43..8.45 rows=1 width=33) (actual time=0.020..0.021 rows=1 loops=11)

  • Index Cond: (a.cod_pac = cod_pac)
9. 56.694 73.788 ↑ 1.5 2 11

Bitmap Heap Scan on hora h (cost=316.45..1,539.54 rows=3 width=35) (actual time=4.102..6.708 rows=2 loops=11)

  • Recheck Cond: (dia_hora = '3'::numeric)
  • Filter: (('2019-07-10'::date >= fecha_inicio) AND ('2019-07-10'::date <= fecha_fin) AND ((rut_med)::double precision = '16276021'::double precision))
  • Rows Removed by Filter: 7148
  • Heap Blocks: exact=10736
10. 17.094 17.094 ↓ 1.3 8,169 11

Bitmap Index Scan on hora_idx2 (cost=0.00..316.44 rows=6,404 width=0) (actual time=1.554..1.554 rows=8,169 loops=11)

  • Index Cond: (dia_hora = '3'::numeric)
11. 3.325 15.576 ↓ 2.1 861 11

HashAggregate (cost=241.34..245.41 rows=407 width=12) (actual time=1.177..1.416 rows=861 loops=11)

  • Group Key: b.scupo
12. 12.251 12.251 ↓ 2.2 897 1

Index Scan using agenda_idx on agenda b (cost=0.43..239.27 rows=414 width=12) (actual time=0.038..12.251 rows=897 loops=1)

  • Index Cond: (fec_agen = '2019-07-10 00:00:00'::timestamp without time zone)
  • Filter: (scupo > 0)
  • Rows Removed by Filter: 5870
13. 0.132 0.132 ↓ 0.0 0 11

Index Scan using lista_espera_cod_agen_key on lista_espera l (cost=0.42..8.44 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=11)

  • Index Cond: (a.cod_agen = cod_agen)
14. 14.410 14.410 ↑ 11.0 1 11

Seq Scan on medico m (cost=0.00..71.53 rows=11 width=11) (actual time=0.396..1.310 rows=1 loops=11)

  • Filter: ((rut_med)::double precision = '16276021'::double precision)
  • Rows Removed by Filter: 2194
Planning time : 2.147 ms