explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NXvJ : Optimization for: QUERY8; plan #RV3g

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.015 4.393 ↑ 1.0 1 1

Aggregate (cost=104.08..104.09 rows=1 width=72) (actual time=4.389..4.393 rows=1 loops=1)

2. 0.008 4.378 ↓ 0.0 0 1

Unique (cost=104.01..104.04 rows=2 width=44) (actual time=4.378..4.378 rows=0 loops=1)

3. 0.045 4.370 ↓ 0.0 0 1

Sort (cost=104.01..104.02 rows=2 width=44) (actual time=4.370..4.370 rows=0 loops=1)

  • Sort Key: nacional.tarjeta_ultima_compra_fecha_internacional, nacional.tarjeta_ultima_compra_fecha_nacional, nacional.tarjeta_ultima_compra_internacional, nacional.tarjeta_ultima_compra_nacional
  • Sort Method: quicksort Memory: 25kB
4. 0.012 4.325 ↓ 0.0 0 1

Append (cost=51.98..104.00 rows=2 width=44) (actual time=4.325..4.325 rows=0 loops=1)

5. 0.009 2.322 ↓ 0.0 0 1

Subquery Scan on nacional (cost=51.98..51.99 rows=1 width=31) (actual time=2.322..2.322 rows=0 loops=1)

6. 0.009 2.313 ↓ 0.0 0 1

Limit (cost=51.98..51.98 rows=1 width=35) (actual time=2.313..2.313 rows=0 loops=1)

7. 0.019 2.304 ↓ 0.0 0 1

Sort (cost=51.98..51.98 rows=1 width=35) (actual time=2.304..2.304 rows=0 loops=1)

  • Sort Key: tt.fecha_transaccion DESC
  • Sort Method: quicksort Memory: 25kB
8. 0.210 2.285 ↓ 0.0 0 1

Hash Join (cost=8.91..51.97 rows=1 width=35) (actual time=2.285..2.285 rows=0 loops=1)

  • Hash Cond: (tt.id_tipo_transaccion_tj = ttt.id)
9. 0.342 0.342 ↓ 1.6 39 1

Index Scan using mcta_transaccion_tarjeta_id_cuenta_idx on mcta_transaccion_tarjeta tt (cost=0.42..43.38 rows=24 width=13) (actual time=0.038..0.342 rows=39 loops=1)

  • Index Cond: (id_cuenta = 23935)
10. 0.035 1.733 ↑ 1.3 3 1

Hash (cost=8.44..8.44 rows=4 width=4) (actual time=1.733..1.733 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.894 1.698 ↑ 1.3 3 1

Hash Join (cost=1.54..8.44 rows=4 width=4) (actual time=1.157..1.698 rows=3 loops=1)

  • Hash Cond: (ttt.id_grupo_transaccion = mgt.id)
12. 0.762 0.762 ↓ 1.1 140 1

Seq Scan on mcta_tipo_transaccion_tarjeta ttt (cost=0.00..6.40 rows=123 width=8) (actual time=0.013..0.762 rows=140 loops=1)

  • Filter: ((codigo_estado_registro = 1) AND ((tipo_transaccion)::text = 'NACIONAL'::text))
  • Rows Removed by Filter: 37
13. 0.020 0.042 ↑ 1.0 1 1

Hash (cost=1.52..1.52 rows=1 width=4) (actual time=0.042..0.042 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.022 0.022 ↑ 1.0 1 1

Seq Scan on mref_grupo_transaccion mgt (cost=0.00..1.52 rows=1 width=4) (actual time=0.012..0.022 rows=1 loops=1)

  • Filter: ((codigo_estado_registro = 1) AND ((codigo)::text = '270'::text))
  • Rows Removed by Filter: 34
15. 0.010 1.991 ↓ 0.0 0 1

Subquery Scan on internacional (cost=51.98..51.99 rows=1 width=31) (actual time=1.991..1.991 rows=0 loops=1)

16. 0.008 1.981 ↓ 0.0 0 1

Limit (cost=51.98..51.98 rows=1 width=35) (actual time=1.981..1.981 rows=0 loops=1)

17. 0.025 1.973 ↓ 0.0 0 1

Sort (cost=51.98..51.98 rows=1 width=35) (actual time=1.973..1.973 rows=0 loops=1)

  • Sort Key: tt_1.fecha_transaccion DESC
  • Sort Method: quicksort Memory: 25kB
18. 0.210 1.948 ↓ 0.0 0 1

Hash Join (cost=8.91..51.97 rows=1 width=35) (actual time=1.948..1.948 rows=0 loops=1)

  • Hash Cond: (tt_1.id_tipo_transaccion_tj = ttt_1.id)
19. 0.221 0.221 ↓ 1.6 39 1

Index Scan using mcta_transaccion_tarjeta_id_cuenta_idx on mcta_transaccion_tarjeta tt_1 (cost=0.42..43.38 rows=24 width=13) (actual time=0.012..0.221 rows=39 loops=1)

  • Index Cond: (id_cuenta = 23935)
20. 0.033 1.517 ↑ 1.3 3 1

Hash (cost=8.44..8.44 rows=4 width=4) (actual time=1.517..1.517 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.694 1.484 ↑ 1.3 3 1

Hash Join (cost=1.54..8.44 rows=4 width=4) (actual time=0.946..1.484 rows=3 loops=1)

  • Hash Cond: (ttt_1.id_grupo_transaccion = mgt_1.id)
22. 0.746 0.746 ↓ 1.1 140 1

Seq Scan on mcta_tipo_transaccion_tarjeta ttt_1 (cost=0.00..6.40 rows=123 width=8) (actual time=0.012..0.746 rows=140 loops=1)

  • Filter: ((codigo_estado_registro = 1) AND ((tipo_transaccion)::text = 'NACIONAL'::text))
  • Rows Removed by Filter: 37
23. 0.021 0.044 ↑ 1.0 1 1

Hash (cost=1.52..1.52 rows=1 width=4) (actual time=0.044..0.044 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
24. 0.023 0.023 ↑ 1.0 1 1

Seq Scan on mref_grupo_transaccion mgt_1 (cost=0.00..1.52 rows=1 width=4) (actual time=0.011..0.023 rows=1 loops=1)

  • Filter: ((codigo_estado_registro = 1) AND ((codigo)::text = '270'::text))
  • Rows Removed by Filter: 34