explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R1Ve

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 29.047 ↓ 0.0 0 1

Sort (cost=10,613.10..10,613.10 rows=1 width=142) (actual time=27.945..29.047 rows=0 loops=1)

  • Sort Key: (to_char(s.dt_hora_sorteo, 'dd/mm/yyyy HH24:MI'::text)), p.boleta
  • Sort Method: quicksort Memory: 25kB
2. 0.003 29.036 ↓ 0.0 0 1

Nested Loop Left Join (cost=4,785.89..10,613.09 rows=1 width=142) (actual time=27.935..29.036 rows=0 loops=1)

  • Join Filter: ((p.accion = 'MTL'::bpchar) AND ("substring"((p.boleta)::text, 1, 9) = (t.boleta)::text))
3. 11.328 29.033 ↓ 0.0 0 1

Gather (cost=4,785.32..8,805.92 rows=1 width=68) (actual time=27.933..29.033 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 3.730 17.705 ↓ 0.0 0 3 / 3

Parallel Hash Anti Join (cost=3,785.32..7,805.82 rows=1 width=68) (actual time=17.698..17.705 rows=0 loops=3)

  • Hash Cond: ((p.juego = pint.juego) AND (p.boleta = pint.boleta) AND (p.sorteo = pint.sorteo))
5. 0.003 5.957 ↓ 0.0 0 2 / 3

Hash Join (cost=55.89..4,076.37 rows=1 width=81) (actual time=8.932..8.936 rows=0 loops=2)

  • Hash Cond: ((p.sorteo)::text = to_char(s.dt_hora_sorteo, 'yyyymmddHH24MI'::text))
  • Join Filter: ((((s.id_juego = '012'::bpchar) AND (p.juego = 'ORO'::bpchar)) OR ((s.id_juego = '010'::bpchar) AND (p.juego = 'QUI'::bpchar)) OR ((s.id_juego = '011'::bpchar) AND (p.juego = 'TOM'::bpchar)) OR ((s.id_juego = '018'::bpchar) AND (p.juego = 'LOT'::bpchar))) AND (((s.dt_hora_sorteo >= to_timestamp('01/09/2020 20:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text)) AND (s.dt_hora_sorteo <= to_timestamp('01/09/2020 20:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text))) OR ((p.tst_pagada_tmn >= to_timestamp('01/09/2020 20:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text)) AND (p.tst_pagada_tmn <= to_timestamp('01/09/2020 20:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text)))))
6. 5.955 5.955 ↓ 0.0 0 2 / 3

Parallel Seq Scan on t_caja_pago_nacional p (cost=0.00..4,019.83 rows=1 width=58) (actual time=8.931..8.932 rows=0 loops=2)

  • Filter: ((juego = 'TOM'::bpchar) AND (banca = '25'::bpchar) AND ('01'::bpchar = agencia) AND ('016'::bpchar = sub_agente) AND ((accion = 'MTK'::bpchar) OR (accion = 'MTL'::bpchar)) AND ((juego = 'ORO'::bpchar) OR (juego = 'QUI'::bpchar) OR (juego = 'TOM'::bpchar) OR (juego = 'LOT'::bpchar)))
  • Rows Removed by Filter: 19,789
7. 0.000 0.000 ↓ 0.0 0 / 3

Hash (cost=42.48..42.48 rows=1,073 width=23) (never executed)

8. 0.000 0.000 ↓ 0.0 0 / 3

Seq Scan on t_sorteo s (cost=0.00..42.48 rows=1,073 width=23) (never executed)

  • Filter: ((id_juego = '012'::bpchar) OR (id_juego = '010'::bpchar) OR (id_juego = '011'::bpchar) OR (id_juego = '018'::bpchar))
9. 0.021 8.018 ↓ 0.0 0 3 / 3

Parallel Hash (cost=3,729.41..3,729.41 rows=1 width=28) (actual time=8.018..8.018 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
10. 7.997 7.997 ↓ 0.0 0 2 / 3

Parallel Seq Scan on t_caja_pago_nacional pint (cost=0.00..3,729.41 rows=1 width=28) (actual time=11.995..11.995 rows=0 loops=2)

  • Filter: ((juego = 'TOM'::bpchar) AND ((accion = 'DTK'::bpchar) OR (accion = 'DTL'::bpchar)))
  • Rows Removed by Filter: 19,789
11. 0.000 0.000 ↓ 0.0 0

Index Scan using t_transaccion_nu_sorteo_idx on t_transaccion t (cost=0.56..1,778.05 rows=1,294 width=67) (never executed)

  • Index Cond: (nu_sorteo = s.id_sorteo)
  • Filter: (s.id_juego = id_transaccion)
Planning time : 1.505 ms
Execution time : 29.166 ms