explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mvMP

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.118 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.46..322.42 rows=1 width=8) (actual time=0.116..0.118 rows=1 loops=1)

  • Filter: ((cp.cod_pac IS NULL) OR (cd.folio_diag IS NULL))
2. 0.006 0.116 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.02..321.18 rows=1 width=22) (actual time=0.114..0.116 rows=1 loops=1)

3. 0.005 0.104 ↑ 1.0 1 1

Nested Loop Anti Join (cost=2.59..289.30 rows=1 width=8) (actual time=0.103..0.104 rows=1 loops=1)

4. 0.000 0.083 ↑ 1.0 1 1

Nested Loop Anti Join (cost=2.15..140.59 rows=1 width=8) (actual time=0.082..0.083 rows=1 loops=1)

  • Join Filter: (a.cod_pac = pac.cod_pac)
5. 0.004 0.048 ↑ 1.0 1 1

Nested Loop Anti Join (cost=1.72..85.76 rows=1 width=8) (actual time=0.047..0.048 rows=1 loops=1)

6. 0.022 0.022 ↑ 1.0 1 1

Index Only Scan using paciente_pkey on paciente pac (cost=0.43..8.45 rows=1 width=8) (actual time=0.021..0.022 rows=1 loops=1)

  • Index Cond: (cod_pac = '1254944'::double precision)
  • Heap Fetches: 1
7. 0.001 0.022 ↓ 0.0 0 1

Nested Loop (cost=1.29..39.30 rows=1 width=6) (actual time=0.022..0.022 rows=0 loops=1)

8. 0.010 0.021 ↓ 0.0 0 1

Nested Loop (cost=0.86..35.53 rows=3 width=14) (actual time=0.021..0.021 rows=0 loops=1)

9. 0.011 0.011 ↓ 0.0 0 1

Index Scan using cabe_presu_idx1 on cabe_presu cp_1 (cost=0.43..31.73 rows=8 width=14) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (cod_pac = (pac.cod_pac)::numeric)
10. 0.000 0.000 ↓ 0.0 0

Index Scan using cabe_tratamiento_folio_presu_key on cabe_tratamiento ct (cost=0.43..0.46 rows=1 width=16) (never executed)

  • Index Cond: (folio_presu = cp_1.folio_presu)
11. 0.000 0.000 ↓ 0.0 0

Index Scan using deta_tratamiento_folio_trata_idx on deta_tratamiento dt (cost=0.43..1.25 rows=1 width=8) (never executed)

  • Index Cond: (folio_trata = ct.folio_trata)
  • Filter: ((cod_sucursal > date_part('epoch'::text, date_trunc('day'::text, (now() - '6 mons'::interval)))) AND (cod_sucursal < date_part('epoch'::text, (('now'::cstring)::date)::timestamp without time zone)))
12. 0.035 0.035 ↓ 0.0 0 1

Index Scan using agenda_idx3 on agenda a (cost=0.43..54.81 rows=2 width=8) (actual time=0.035..0.035 rows=0 loops=1)

  • Index Cond: (cod_pac = '1254944'::double precision)
  • Filter: ((cod_serv = '3'::double precision) AND (fec_agen < ('now'::cstring)::date) AND (fec_agen > date_trunc('day'::text, (now() - '6 mons'::interval))))
  • Rows Removed by Filter: 3
13. 0.016 0.016 ↓ 0.0 0 1

Index Scan using c_maestro_mov_idx1 on c_maestro_mov mov (cost=0.44..74.57 rows=1 width=6) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (cod_pac = (pac.cod_pac)::numeric)
  • Filter: (((tipo_mov)::text = 'AC'::text) AND (activo = '1'::double precision) AND ((fecha_tra)::double precision < date_part('epoch'::text, (('now'::cstring)::date)::timestamp without time zone)) AND ((fecha_tra)::double precision > date_part('epoch'::text, date_trunc('day'::text, ((now())::date - '6 mons'::interval)))))
  • Rows Removed by Filter: 2
14. 0.006 0.006 ↓ 0.0 0 1

Index Scan using cabe_presu_idx1 on cabe_presu cp (cost=0.43..31.87 rows=1 width=14) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (cod_pac = (pac.cod_pac)::numeric)
  • Filter: ((fecha_presu < ('now'::cstring)::date) AND (fecha_presu > date_trunc('day'::text, (now() - '6 mons'::interval))))
15. 0.000 0.000 ↓ 0.0 0 1

Index Scan using cabe_diag_idx on cabe_diag cd (cost=0.43..1.24 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (folio_diag = cp.folio_diag)
  • Filter: (cod_esp <> '23'::numeric)