explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1D1q

Settings
# exclusive inclusive rows x rows loops node
1. 428.869 12,017.442 ↑ 1.4 64,538 1

Sort (cost=1,147,362.58..1,147,590.15 rows=91,027 width=369) (actual time=11,999.531..12,017.442 rows=64,538 loops=1)

  • Sort Key: m.cod_estado, b.es_debito_pos, m.fecha_tra
  • Sort Method: quicksort Memory: 33,623kB
2.          

CTE notas_credito

3. 21.824 107.641 ↓ 1.1 14,556 1

GroupAggregate (cost=1,429.54..1,799.29 rows=13,221 width=50) (actual time=80.706..107.641 rows=14,556 loops=1)

  • Group Key: c_notas_de_credito.id_emision, c_notas_de_credito.boleta_elec
4. 80.896 85.817 ↑ 1.0 16,283 1

Sort (cost=1,429.54..1,470.44 rows=16,359 width=19) (actual time=80.682..85.817 rows=16,283 loops=1)

  • Sort Key: c_notas_de_credito.id_emision, c_notas_de_credito.boleta_elec
  • Sort Method: quicksort Memory: 1,657kB
5. 4.921 4.921 ↑ 1.0 16,283 1

Seq Scan on c_notas_de_credito (cost=0.00..284.59 rows=16,359 width=19) (actual time=0.017..4.921 rows=16,283 loops=1)

6. 75.090 11,588.573 ↑ 1.4 64,538 1

Hash Left Join (cost=1,091,372.67..1,138,065.39 rows=91,027 width=369) (actual time=10,754.352..11,588.573 rows=64,538 loops=1)

  • Hash Cond: (p.cod_conv = conv.cod_conv)
7. 26.770 11,513.450 ↑ 1.4 64,538 1

Hash Join (cost=1,091,369.64..1,134,079.93 rows=91,027 width=319) (actual time=10,754.278..11,513.450 rows=64,538 loops=1)

  • Hash Cond: (m.centro = cs.cod_suc)
8. 693.383 11,486.598 ↑ 1.4 64,538 1

Hash Left Join (cost=1,091,361.31..1,132,819.94 rows=91,037 width=309) (actual time=10,754.179..11,486.598 rows=64,538 loops=1)

  • Hash Cond: (((m.folio_tra)::numeric)::double precision = ppto.folio_presu)
9. 86.998 8,497.967 ↑ 1.4 64,538 1

Hash Right Join (cost=820,528.70..823,348.45 rows=91,037 width=301) (actual time=8,454.559..8,497.967 rows=64,538 loops=1)

  • Hash Cond: (cajp.id_mov = m.id_mov)
10. 16.175 16.175 ↓ 1.1 159,606 1

Seq Scan on c_ajuste_pesos cajp (cost=0.00..2,278.10 rows=141,510 width=32) (actual time=0.016..16.175 rows=159,606 loops=1)

11. 86.469 8,394.794 ↑ 1.4 64,538 1

Hash (cost=819,390.74..819,390.74 rows=91,037 width=289) (actual time=8,394.794..8,394.794 rows=64,538 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 17,275kB
12. 66.551 8,308.325 ↑ 1.4 64,538 1

Hash Right Join (cost=818,696.10..819,390.74 rows=91,037 width=289) (actual time=8,207.703..8,308.325 rows=64,538 loops=1)

  • Hash Cond: ((cnc.id_emision = bol.id_emision) AND ((cnc.boleta_elec)::text = (bol.boleta_elec)::text))
13. 116.431 116.431 ↓ 1.1 14,556 1

CTE Scan on notas_credito cnc (cost=0.00..264.42 rows=13,221 width=78) (actual time=80.711..116.431 rows=14,556 loops=1)

14. 93.352 8,125.343 ↑ 1.4 64,538 1

Hash (cost=817,330.54..817,330.54 rows=91,037 width=257) (actual time=8,125.343..8,125.343 rows=64,538 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 17,243kB
15. 661.129 8,031.991 ↑ 1.4 64,538 1

Merge Right Join (cost=585,695.28..817,330.54 rows=91,037 width=257) (actual time=7,862.945..8,031.991 rows=64,538 loops=1)

  • Merge Cond: ((bol.cod_boleta = m.boleta) AND ((bol.cod_caja)::text = (m.cod_caja)::text))
16. 1,727.269 1,727.269 ↑ 1.0 2,729,069 1

Index Scan using c_boletas_idx on c_boletas bol (cost=0.43..217,166.97 rows=2,749,916 width=33) (actual time=0.015..1,727.269 rows=2,729,069 loops=1)

17. 91.648 5,643.593 ↑ 1.4 64,538 1

Sort (cost=585,694.85..585,922.44 rows=91,037 width=232) (actual time=5,614.623..5,643.593 rows=64,538 loops=1)

  • Sort Key: m.boleta, m.cod_caja
  • Sort Method: quicksort Memory: 18,819kB
18. 17.137 5,551.945 ↑ 1.4 64,538 1

Hash Left Join (cost=552,156.50..578,196.05 rows=91,037 width=232) (actual time=5,080.230..5,551.945 rows=64,538 loops=1)

  • Hash Cond: ((p.cod_cat_pac)::numeric = cp.rutn)
19. 22.408 5,534.760 ↑ 1.4 64,538 1

Hash Left Join (cost=552,153.50..577,332.76 rows=91,037 width=218) (actual time=5,080.171..5,534.760 rows=64,538 loops=1)

  • Hash Cond: ((m.cod_banco)::text = (b.cod_banco)::text)
20. 23.333 5,512.319 ↑ 1.4 64,538 1

Hash Left Join (cost=552,151.20..576,078.81 rows=91,037 width=204) (actual time=5,080.128..5,512.319 rows=64,538 loops=1)

  • Hash Cond: ((m.cod_estado)::text = (c.cod_estado)::text)
21. 349.573 5,488.956 ↑ 1.4 64,538 1

Hash Join (cost=552,149.45..575,002.94 rows=91,037 width=186) (actual time=5,080.080..5,488.956 rows=64,538 loops=1)

  • Hash Cond: ((m.cod_pac)::double precision = p.cod_pac)
22. 65.089 3,347.867 ↑ 1.4 64,538 1

Hash Right Join (cost=411,749.07..415,765.01 rows=91,037 width=139) (actual time=3,282.801..3,347.867 rows=64,538 loops=1)

  • Hash Cond: ((med.rut_med)::double precision = diag.rut_med)
23. 0.551 0.551 ↓ 1.0 2,581 1

Seq Scan on medico med (cost=0.00..68.79 rows=2,579 width=30) (actual time=0.012..0.551 rows=2,581 loops=1)

24. 28.881 3,282.227 ↑ 1.0 64,538 1

Hash (cost=410,915.12..410,915.12 rows=66,716 width=123) (actual time=3,282.227..3,282.227 rows=64,538 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 10,213kB
25. 8.065 3,253.346 ↑ 1.0 64,538 1

Nested Loop Left Join (cost=270,833.47..410,915.12 rows=66,716 width=123) (actual time=2,196.570..3,253.346 rows=64,538 loops=1)

26. 726.057 3,051.667 ↑ 1.0 64,538 1

Hash Left Join (cost=270,833.04..375,101.18 rows=66,716 width=123) (actual time=2,196.554..3,051.667 rows=64,538 loops=1)

  • Hash Cond: (((m.folio_tra)::numeric)::double precision = presu.folio_presu)
27. 133.563 133.563 ↑ 1.0 64,538 1

Index Scan using c_maestro_mov_fecha_tra on c_maestro_mov m (cost=0.43..71,617.72 rows=66,716 width=107) (actual time=0.080..133.563 rows=64,538 loops=1)

  • Index Cond: ((fecha_tra >= '1596254400'::numeric) AND (fecha_tra <= '1598932800'::numeric))
  • Filter: ((cod_caja IS NOT NULL) AND ((cod_estado)::text <> '666'::text) AND (boleta > 0))
  • Rows Removed by Filter: 111,806
28. 1,021.451 2,192.047 ↑ 1.0 4,587,035 1

Hash (cost=183,309.27..183,309.27 rows=4,767,227 width=24) (actual time=2,192.047..2,192.047 rows=4,587,035 loops=1)

  • Buckets: 1,048,576 Batches: 8 Memory Usage: 39,549kB
29. 1,170.596 1,170.596 ↑ 1.0 4,587,035 1

Seq Scan on cabe_presu presu (cost=0.00..183,309.27 rows=4,767,227 width=24) (actual time=0.010..1,170.596 rows=4,587,035 loops=1)

30. 193.614 193.614 ↑ 1.0 1 64,538

Index Scan using cabe_diag_idx on cabe_diag diag (cost=0.43..0.53 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=64,538)

  • Index Cond: (presu.folio_diag = folio_diag)
31. 857.736 1,791.516 ↑ 1.0 1,398,931 1

Hash (cost=109,078.28..109,078.28 rows=1,406,728 width=55) (actual time=1,791.516..1,791.516 rows=1,398,931 loops=1)

  • Buckets: 1,048,576 Batches: 4 Memory Usage: 39,487kB
32. 933.780 933.780 ↑ 1.0 1,398,931 1

Seq Scan on paciente p (cost=0.00..109,078.28 rows=1,406,728 width=55) (actual time=0.011..933.780 rows=1,398,931 loops=1)

33. 0.009 0.030 ↓ 1.3 43 1

Hash (cost=1.33..1.33 rows=33 width=22) (actual time=0.030..0.030 rows=43 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
34. 0.021 0.021 ↓ 1.3 43 1

Seq Scan on c_estadoscontables c (cost=0.00..1.33 rows=33 width=22) (actual time=0.008..0.021 rows=43 loops=1)

35. 0.016 0.033 ↓ 1.1 64 1

Hash (cost=1.58..1.58 rows=58 width=22) (actual time=0.033..0.033 rows=64 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
36. 0.017 0.017 ↓ 1.1 64 1

Seq Scan on c_bancos b (cost=0.00..1.58 rows=58 width=22) (actual time=0.005..0.017 rows=64 loops=1)

37. 0.029 0.048 ↑ 1.0 89 1

Hash (cost=1.89..1.89 rows=89 width=24) (actual time=0.048..0.048 rows=89 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
38. 0.019 0.019 ↑ 1.0 89 1

Seq Scan on categoria_paciente cp (cost=0.00..1.89 rows=89 width=24) (actual time=0.005..0.019 rows=89 loops=1)

39. 1,035.559 2,295.248 ↑ 1.0 4,587,035 1

Hash (cost=183,309.27..183,309.27 rows=4,767,227 width=24) (actual time=2,295.248..2,295.248 rows=4,587,035 loops=1)

  • Buckets: 1,048,576 Batches: 8 Memory Usage: 39,549kB
40. 1,259.689 1,259.689 ↑ 1.0 4,587,035 1

Seq Scan on cabe_presu ppto (cost=0.00..183,309.27 rows=4,767,227 width=24) (actual time=0.014..1,259.689 rows=4,587,035 loops=1)

41. 0.038 0.082 ↑ 1.0 59 1

Hash (cost=7.59..7.59 rows=59 width=20) (actual time=0.082..0.082 rows=59 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
42. 0.044 0.044 ↑ 1.0 59 1

Seq Scan on cliente_sucursal cs (cost=0.00..7.59 rows=59 width=20) (actual time=0.012..0.044 rows=59 loops=1)

43. 0.014 0.033 ↓ 1.0 48 1

Hash (cost=2.46..2.46 rows=46 width=25) (actual time=0.033..0.033 rows=48 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
44. 0.019 0.019 ↓ 1.0 48 1

Seq Scan on convenio conv (cost=0.00..2.46 rows=46 width=25) (actual time=0.008..0.019 rows=48 loops=1)