explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JuNa

Settings
# exclusive inclusive rows x rows loops node
1. 2.822 593.223 ↓ 424.0 424 1

Sort (cost=5,409.77..5,409.78 rows=1 width=671) (actual time=593.175..593.223 rows=424 loops=1)

  • Sort Key: m.cod_estado, m.id_mov
  • Sort Method: quicksort Memory: 165kB
2. 2.229 590.401 ↓ 424.0 424 1

Nested Loop Left Join (cost=90.65..5,409.76 rows=1 width=671) (actual time=1.661..590.401 rows=424 loops=1)

  • Join Filter: (cs.cod_suc = m.centro)
3. 277.870 586.900 ↓ 424.0 424 1

Nested Loop Left Join (cost=90.65..5,408.65 rows=1 width=607) (actual time=1.647..586.900 rows=424 loops=1)

  • Join Filter: (((bol.cod_caja)::text = (m.cod_caja)::text) AND (bol.cod_boleta = m.boleta))
  • Rows Removed by Join Filter: 889136
4. 0.512 51.990 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.78..3,438.70 rows=1 width=561) (actual time=1.361..51.990 rows=420 loops=1)

5. 0.445 51.478 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.64..3,438.51 rows=1 width=497) (actual time=1.360..51.478 rows=420 loops=1)

6. 0.785 51.033 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.49..3,438.23 rows=1 width=469) (actual time=1.358..51.033 rows=420 loops=1)

7. 2.061 49.408 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.33..3,430.05 rows=1 width=433) (actual time=1.353..49.408 rows=420 loops=1)

  • Join Filter: ((m.cod_banco)::text = (b.cod_banco)::text)
  • Rows Removed by Join Filter: 9660
8. 2.801 46.087 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.33..3,428.51 rows=1 width=318) (actual time=1.341..46.087 rows=420 loops=1)

  • Join Filter: ((m.cod_estado)::text = (c.cod_estado)::text)
  • Rows Removed by Join Filter: 12180
9. 0.631 41.606 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.33..3,426.83 rows=1 width=298) (actual time=1.321..41.606 rows=420 loops=1)

10. 0.518 36.775 ↓ 420.0 420 1

Nested Loop Left Join (cost=57.04..3,418.52 rows=1 width=255) (actual time=1.301..36.775 rows=420 loops=1)

11. 3.425 3.917 ↓ 420.0 420 1

Bitmap Heap Scan on c_maestro_mov m (cost=47.91..3,407.54 rows=1 width=97) (actual time=1.166..3.917 rows=420 loops=1)

  • Recheck Cond: ((cod_caja IS NOT NULL) AND ((cod_caja)::text = '30'::text))
  • Filter: (((cod_estado)::text <> '666'::text) AND (fecha_tra >= '1564632000'::numeric) AND (fecha_tra <= '1574909999'::numeric) AND (boleta > '0'::numeric) AND (comision > '0'::numeric) AND (centro = '3'::numeric))
  • Rows Removed by Filter: 1879
  • Heap Blocks: exact=909
12. 0.492 0.492 ↓ 2.3 2,674 1

Bitmap Index Scan on c_maestro_mov_idx (cost=0.00..47.91 rows=1,149 width=0) (actual time=0.492..0.492 rows=2,674 loops=1)

  • Index Cond: ((cod_caja IS NOT NULL) AND ((cod_caja)::text = '30'::text))
13. 2.520 32.340 ↑ 1.0 1 420

Nested Loop Left Join (cost=9.13..10.97 rows=1 width=166) (actual time=0.059..0.077 rows=1 loops=420)

14. 7.980 29.400 ↑ 1.0 1 420

Hash Join (cost=8.99..10.80 rows=1 width=51) (actual time=0.053..0.070 rows=1 loops=420)

  • Hash Cond: ((m_1.rut_med)::double precision = d.rut_med)
15. 9.240 9.240 ↓ 1.0 33 420

Seq Scan on medico m_1 (cost=0.00..1.64 rows=32 width=64) (actual time=0.003..0.022 rows=33 loops=420)

16. 0.420 12.180 ↑ 1.0 1 420

Hash (cost=8.98..8.98 rows=1 width=27) (actual time=0.029..0.029 rows=1 loops=420)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 1.680 11.760 ↑ 1.0 1 420

Nested Loop (cost=0.84..8.98 rows=1 width=27) (actual time=0.027..0.028 rows=1 loops=420)

18. 5.880 5.880 ↑ 1.0 1 420

Index Scan using cabe_presu_pkey on cabe_presu p_1 (cost=0.42..8.44 rows=1 width=24) (actual time=0.014..0.014 rows=1 loops=420)

  • Index Cond: (folio_presu = ((m.folio_tra)::numeric)::double precision)
19. 4.200 4.200 ↑ 1.0 1 420

Index Scan using cabe_diag_idx on cabe_diag d (cost=0.42..0.53 rows=1 width=19) (actual time=0.009..0.010 rows=1 loops=420)

  • Index Cond: (folio_diag = p_1.folio_diag)
20. 0.420 0.420 ↓ 0.0 0 420

Index Scan using especialidad_pkey on especialidad esp (cost=0.14..0.15 rows=1 width=134) (actual time=0.001..0.001 rows=0 loops=420)

  • Index Cond: (cod_esp = d.cod_esp)
21. 4.200 4.200 ↑ 1.0 1 420

Index Scan using paciente_pkey on paciente p (cost=0.29..8.31 rows=1 width=51) (actual time=0.008..0.010 rows=1 loops=420)

  • Index Cond: ((m.cod_pac)::double precision = cod_pac)
22. 1.680 1.680 ↑ 1.0 30 420

Seq Scan on c_estadoscontables c (cost=0.00..1.30 rows=30 width=25) (actual time=0.002..0.004 rows=30 loops=420)

23. 1.260 1.260 ↑ 1.0 24 420

Seq Scan on c_bancos b (cost=0.00..1.24 rows=24 width=156) (actual time=0.001..0.003 rows=24 loops=420)

24. 0.840 0.840 ↓ 0.0 0 420

Index Scan using mod_doc_presupuesto_folio_presu_key on mod_doc_presupuesto doc_pre (cost=0.15..8.17 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=420)

  • Index Cond: (folio_presu = ((m.folio_tra)::numeric)::double precision)
25. 0.000 0.000 ↓ 0.0 0 420

Index Scan using mod_doc_asignatura_pkey on mod_doc_asignatura doc_asig (cost=0.15..0.27 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=420)

  • Index Cond: (doc_pre.id_asignatura = id_asignatura)
26. 0.000 0.000 ↓ 0.0 0 420

Index Scan using medico_idx on medico med (cost=0.14..0.18 rows=1 width=128) (actual time=0.000..0.000 rows=0 loops=420)

  • Index Cond: (rut_med = doc_pre.rut_docente)
27. 180.180 257.040 ↓ 1.3 2,118 420

Bitmap Heap Scan on c_boletas bol (cost=32.88..1,945.59 rows=1,624 width=53) (actual time=0.208..0.612 rows=2,118 loops=420)

  • Recheck Cond: ((cod_caja)::text = '30'::text)
  • Heap Blocks: exact=94920
28. 76.860 76.860 ↓ 1.3 2,118 420

Bitmap Index Scan on c_boletas_idx_cod_caja (cost=0.00..32.47 rows=1,624 width=0) (actual time=0.183..0.183 rows=2,118 loops=420)

  • Index Cond: ((cod_caja)::text = '30'::text)
29. 1.272 1.272 ↑ 1.0 1 424

Seq Scan on cliente_sucursal cs (cost=0.00..1.09 rows=1 width=64) (actual time=0.003..0.003 rows=1 loops=424)

  • Filter: (cod_suc = '3'::numeric)
  • Rows Removed by Filter: 7
Planning time : 3.995 ms