explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NI1E

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 4,890.728 ↑ 2,103,651.5 2 1

Sort (cost=9,234,794.00..9,245,312.25 rows=4,207,303 width=488) (actual time=4,890.727..4,890.728 rows=2 loops=1)

  • Sort Key: b.btcr_fecha DESC, b.btcr_id DESC
  • Sort Method: quicksort Memory: 26kB
2. 0.001 4,890.707 ↑ 2,103,651.5 2 1

Append (cost=61,953.08..7,020,603.22 rows=4,207,303 width=488) (actual time=4,886.288..4,890.707 rows=2 loops=1)

3. 63.306 4,890.632 ↑ 2,103,651.0 2 1

Hash Join (cost=61,953.08..6,978,479.70 rows=4,207,302 width=331) (actual time=4,886.287..4,890.632 rows=2 loops=1)

  • Hash Cond: ((b.caso_id + '0'::numeric) = ca.caso_id)
4. 3,919.331 3,919.355 ↑ 2,103,651.0 2 1

Seq Scan on bitacoras b (cost=11.65..207,674.03 rows=4,207,302 width=139) (actual time=3,919.332..3,919.355 rows=2 loops=1)

  • Filter: ((hashed SubPlan 2) OR (hashed SubPlan 3))
  • Rows Removed by Filter: 5602995
5.          

SubPlan (forSeq Scan)

6. 0.019 0.019 ↓ 0.0 0 1

Index Only Scan using wfa_padre_hijos_pk on wfa_padre_hijos wfa_padre_hijos1 (cost=0.42..10.63 rows=3 width=6) (actual time=0.019..0.019 rows=0 loops=1)

  • Index Cond: (wfa_padre = '895541'::numeric)
  • Heap Fetches: 0
7. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on dual dual1 (cost=0.00..1.01 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)

8. 247.442 907.971 ↑ 1.0 871,917 1

Hash (cost=47,622.30..47,622.30 rows=872,730 width=6) (actual time=907.971..907.971 rows=871,917 loops=1)

  • Buckets: 524288 Batches: 4 Memory Usage: 12431kB
9. 660.529 660.529 ↑ 1.0 871,917 1

Seq Scan on casos ca (cost=0.00..47,622.30 rows=872,730 width=6) (actual time=0.593..660.529 rows=871,917 loops=1)

10. 0.004 0.074 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=12.45..50.51 rows=1 width=387) (actual time=0.074..0.074 rows=0 loops=1)

11. 0.002 0.070 ↓ 0.0 0 1

Nested Loop (cost=12.45..50.50 rows=1 width=387) (actual time=0.070..0.070 rows=0 loops=1)

12. 0.004 0.060 ↑ 4.0 1 1

Nested Loop (cost=12.16..41.54 rows=4 width=38) (actual time=0.058..0.060 rows=1 loops=1)

13. 0.011 0.036 ↑ 4.0 1 1

HashAggregate (cost=11.73..11.77 rows=4 width=32) (actual time=0.035..0.036 rows=1 loops=1)

  • Group Key: wfa_padre_hijos2.wfa_hijo
14. 0.001 0.025 ↑ 4.0 1 1

Append (cost=0.42..11.68 rows=4 width=32) (actual time=0.024..0.025 rows=1 loops=1)

15. 0.016 0.016 ↓ 0.0 0 1

Index Only Scan using wfa_padre_hijos_pk on wfa_padre_hijos wfa_padre_hijos2 (cost=0.42..10.63 rows=3 width=6) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (wfa_padre = '895541'::numeric)
  • Heap Fetches: 0
16. 0.002 0.008 ↑ 1.0 1 1

Subquery Scan on *SELECT* 2_1 (cost=0.00..1.02 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=1)

17. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on dual dual2 (cost=0.00..1.01 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

18. 0.020 0.020 ↑ 1.0 1 1

Index Only Scan using caso_pk on casos c (cost=0.42..7.44 rows=1 width=6) (actual time=0.020..0.020 rows=1 loops=1)

  • Index Cond: (caso_id = wfa_padre_hijos2.wfa_hijo)
  • Heap Fetches: 1
19. 0.008 0.008 ↓ 0.0 0 1

Index Scan using wfa_actividades_i1 on wfa_actividades act (cost=0.29..0.31 rows=1 width=132) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (caso_id = c.caso_id)
20.          

SubPlan (forNested Loop)

21. 0.000 0.000 ↓ 0.0 0

Index Scan using wfa_tipo_actividad_pk on wfa_tipo_actividad (cost=0.14..7.16 rows=1 width=516) (never executed)

  • Index Cond: (wfa_tact_id = act.wfa_tact_id)