explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 74ou

Settings
# exclusive inclusive rows x rows loops node
1. 0.054 49,484.387 ↓ 88.1 705 1

Limit (cost=4,160,853.55..4,160,853.57 rows=8 width=1,470) (actual time=49,484.233..49,484.387 rows=705 loops=1)

2. 1.424 49,484.333 ↓ 88.1 705 1

Sort (cost=4,160,853.55..4,160,853.57 rows=8 width=1,470) (actual time=49,484.233..49,484.333 rows=705 loops=1)

  • Sort Key: payoutorde0_.orden_pago_id
  • Sort Method: quicksort Memory: 700kB
3. 77.247 49,482.909 ↓ 88.1 705 1

Nested Loop (cost=357.48..4,160,853.43 rows=8 width=1,470) (actual time=49,465.683..49,482.909 rows=705 loops=1)

  • Join Filter: (payoutorde0_.banco_id = bank8_.banco_id)
  • Rows Removed by Join Filter: 810750
4. 0.138 0.138 ↑ 1.0 1,151 1

Seq Scan on banco bank8_ (cost=0.00..23.51 rows=1,151 width=39) (actual time=0.008..0.138 rows=1,151 loops=1)

5. 40.539 49,405.524 ↓ 88.1 705 1,151

Materialize (cost=357.48..4,160,691.82 rows=8 width=1,431) (actual time=0.045..42.924 rows=705 loops=1,151)

6. 63.857 49,364.985 ↓ 88.1 705 1

Nested Loop Left Join (cost=357.48..4,160,691.78 rows=8 width=1,431) (actual time=51.293..49,364.985 rows=705 loops=1)

  • Join Filter: (accountban5_.banco_intermediacion_id = bank7_.banco_id)
  • Rows Removed by Join Filter: 811446
7. 69.706 49,263.058 ↓ 88.1 705 1

Nested Loop Left Join (cost=357.48..4,160,527.27 rows=8 width=1,392) (actual time=50.742..49,263.058 rows=705 loops=1)

  • Join Filter: (accountban5_.banco_id = bank6_.banco_id)
  • Rows Removed by Join Filter: 810750
8. 18.086 49,150.347 ↓ 88.1 705 1

Nested Loop Left Join (cost=357.48..4,160,362.76 rows=8 width=1,353) (actual time=50.222..49,150.347 rows=705 loops=1)

  • -> Index Scan using datos_bancarios_pkey on datos_bancarios accountban5_ (cost=0.42..0.48 rows=1 width=248) (actual time=0.022..0.023 ro
9. 35.960 49,132.261 ↓ 88.1 705 1

Nested Loop (cost=357.06..4,160,358.81 rows=8 width=1,105) (actual time=50.178..49,132.261 rows=705 loops=1)

  • -> Index Scan using usuario_pkey on usuario merchant4_ (cost=0.42..0.63 rows=1 width=18) (actual time=0.048..0.048 rows=1 loops=70
  • Index Cond: (account3_.cuenta_id = cuenta_id)
10. 22.635 49,096.301 ↓ 88.1 705 1

Nested Loop (cost=356.63..4,160,353.69 rows=8 width=1,087) (actual time=50.137..49,096.301 rows=705 loops=1)

  • Join Filter: (payoutorde0_.cuenta_id = account3_.cuenta_id)
  • -> Index Scan using cuenta_pkey on cuenta account3_ (cost=0.42..3.51 rows=1 width=132) (actual time=0.028..0.028 rows=1 loop
  • Index Cond: (usuario_id = account3_.usuario_id)
11. 17.740 49,073.666 ↓ 88.1 705 1

Nested Loop (cost=356.21..4,160,325.48 rows=8 width=959) (actual time=50.103..49,073.666 rows=705 loops=1)

  • -> Index Only Scan using cuenta_pkey on cuenta account1_ (cost=0.42..4.20 rows=1 width=4) (actual time=0.021..0.021 ro
  • Index Cond: (cuenta_id = account1_.cuenta_id)
12. 14.108 49,055.926 ↓ 88.1 705 1

Hash Left Join (cost=355.79..4,160,291.77 rows=8 width=955) (actual time=50.048..49,055.926 rows=705 loops=1)

  • Hash Cond: (payoutorde0_.documento_ordenes_pago_id = providerre2_.documento_ordenes_pago_id)
  • Filter: (((providerre2_.proveedor)::text = 'BR_CIP'::text) OR (((payoutorde0_.estado_orden_pago)::text = 'IN_PAYU_
  • Rows Removed by Filter: 1248
  • -> Index Scan using idx_orden_pago_fecha_creacion on orden_pago payoutorde0_ (cost=0.42..2270.26 rows=846 width=
  • Index Cond: ((fecha_creacion >= '2019-02-05 00:00:00'::timestamp without time zone) AND (fecha_creacion < '2
  • Index Cond: (cuenta_id = payoutorde0_.cuenta_id)
  • Heap Fetches: 9
13. 5.348 5.348 ↓ 1.1 11,801 1

Hash (cost=219.05..219.05 rows=10,905 width=22) (actual time=5.348..5.348 rows=11,801 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 614kB
  • -> Seq Scan on documento_ordenes_pago providerre2_ (cost=0.00..219.05 rows=10905 width=22) (actual time=0.
14.          

SubPlan (forHash Left Join)

15. 49,036.470 49,036.470 ↑ 1.0 1 1,110

Aggregate (cost=5,009.20..5,009.21 rows=1 width=8) (actual time=44.177..44.177 rows=1 loops=1,110)

  • -> Seq Scan on orden_pago_detalle payoutorde9_ (cost=0.00..5009.20 rows=2 width=37) (actual time=43.963.
  • Filter: (((tipo)::text = ANY ('{CREDIT,ANTICIPATION}'::text[])) AND (valor_ajustado > '0'::numeric)
  • Rows Removed by Filter: 135896
16. 42.764 43.005 ↑ 1.0 1,151 705

Materialize (cost=0.00..29.26 rows=1,151 width=39) (actual time=0.001..0.061 rows=1,151 loops=705)

17. 0.241 0.241 ↑ 1.0 1,151 1

Seq Scan on banco bank6_ (cost=0.00..23.51 rows=1,151 width=39) (actual time=0.005..0.241 rows=1,151 loops=1)

18. 37.863 38.070 ↑ 1.0 1,151 705

Materialize (cost=0.00..29.26 rows=1,151 width=39) (actual time=0.000..0.054 rows=1,151 loops=705)

19. 0.207 0.207 ↑ 1.0 1,151 1

Seq Scan on banco bank7_ (cost=0.00..23.51 rows=1,151 width=39) (actual time=0.002..0.207 rows=1,151 loops=1)