explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ldm2

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=14,662.20..14,662.21 rows=1 width=0) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,620.63..14,662.20 rows=1 width=0) (actual rows= loops=)

  • Join Filter: (gel5.ganado_id = g.ganado_id)
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14,620.34..14,661.85 rows=1 width=12) (actual rows= loops=)

  • Join Filter: (ger5.ganado_id = gel5.ganado_id)
4. 0.000 0.000 ↓ 0.0

Merge Join (cost=6,004.89..6,004.92 rows=1 width=8) (actual rows= loops=)

  • Merge Cond: (gel5.ganado_id = gf5.ganado_id)
5. 0.000 0.000 ↓ 0.0

Sort (cost=2,615.73..2,615.74 rows=3 width=4) (actual rows= loops=)

  • Sort Key: gel5.ganado_id
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,590.99..2,615.71 rows=3 width=4) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,590.71..2,590.74 rows=3 width=8) (actual rows= loops=)

  • Group Key: gel3.ganado_id
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,993.72..2,590.69 rows=3 width=8) (actual rows= loops=)

  • Hash Cond: ((gel.ganado_id = gel3.ganado_id) AND ((max(gel.created)) = gel3.created))
9. 0.000 0.000 ↓ 0.0

HashAggregate (cost=859.89..959.38 rows=9,949 width=12) (actual rows= loops=)

  • Group Key: gel.ganado_id
10. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_estado_leche gel (cost=0.00..722.93 rows=27,393 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash (cost=722.93..722.93 rows=27,393 width=16) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_estado_leche gel3 (cost=0.00..722.93 rows=27,393 width=16) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using ganado_estado_leche_pk on ganado_estado_leche gel5 (cost=0.29..8.30 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ganado_estado_leche_id = (max(gel3.ganado_estado_leche_id)))
14. 0.000 0.000 ↓ 0.0

Sort (cost=3,389.16..3,389.16 rows=2 width=4) (actual rows= loops=)

  • Sort Key: gf5.ganado_id
15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,372.76..3,389.15 rows=2 width=4) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,372.48..3,372.50 rows=2 width=8) (actual rows= loops=)

  • Group Key: gf3.ganado_id
17. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,402.56..3,372.47 rows=2 width=8) (actual rows= loops=)

  • Hash Cond: ((gf.ganado_id = gf3.ganado_id) AND ((max(gf.created)) = gf3.created))
18. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,040.46..1,255.99 rows=21,553 width=12) (actual rows= loops=)

  • Group Key: gf.ganado_id
19. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_fundo gf (cost=0.00..879.64 rows=32,164 width=12) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=879.64..879.64 rows=32,164 width=16) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_fundo gf3 (cost=0.00..879.64 rows=32,164 width=16) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using ganado_fundo_pk on ganado_fundo gf5 (cost=0.29..8.30 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ganado_fundo_id = (max(gf3.ganado_fundo_id)))
23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8,615.46..8,656.86 rows=5 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

HashAggregate (cost=8,615.16..8,615.21 rows=5 width=8) (actual rows= loops=)

  • Group Key: ger3.ganado_id
25. 0.000 0.000 ↓ 0.0

Hash Join (cost=6,362.52..8,615.14 rows=5 width=8) (actual rows= loops=)

  • Hash Cond: ((ger.ganado_id = ger3.ganado_id) AND ((max(ger.created)) = ger3.created))
26. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2,663.94..2,785.47 rows=12,153 width=12) (actual rows= loops=)

  • Group Key: ger.ganado_id
27. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_estado_reproductivo ger (cost=0.00..2,316.63 rows=69,463 width=12) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash (cost=2,316.63..2,316.63 rows=69,463 width=16) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Seq Scan on ganado_estado_reproductivo ger3 (cost=0.00..2,316.63 rows=69,463 width=16) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Scan using ganado_estado_reproductivo_pk on ganado_estado_reproductivo ger5 (cost=0.29..8.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ganado_estado_reproductivo_id = (max(ger3.ganado_estado_reproductivo_id)))
31. 0.000 0.000 ↓ 0.0

Index Scan using ganado_pk on ganado g (cost=0.29..0.33 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (ganado_id = ger5.ganado_id)
  • Filter: (organizacion_id = 21)