explain.depesz.com

PostgreSQL's explain analyze made readable

Result: loGo

Settings
# exclusive inclusive rows x rows loops node
1. 28.468 9,525,351.240 ↑ 1.0 1 1

Aggregate (cost=15,125.43..15,125.44 rows=1 width=0) (actual time=9,525,351.237..9,525,351.240 rows=1 loops=1)

  • Buffers: shared hit=415044201, temp read=180 written=178
2. 326.569 9,525,322.772 ↓ 2,924.0 2,924 1

Nested Loop (cost=15,092.21..15,125.43 rows=1 width=0) (actual time=6,773,383.496..9,525,322.772 rows=2,924 loops=1)

  • Join Filter: (gel5.ganado_id = g.ganado_id)
  • Buffers: shared hit=415044201, temp read=180 written=178
3. 868,308.500 9,524,757.619 ↓ 9,941.0 9,941 1

Nested Loop (cost=15,091.93..15,125.08 rows=1 width=12) (actual time=7,896.944..9,524,757.619 rows=9,941 loops=1)

  • Join Filter: (ger5.ganado_id = gel5.ganado_id)
  • Rows Removed by Join Filter: 138032667
  • Buffers: shared hit=415014326, temp read=180 written=178
4. 334.739 5,795.591 ↓ 9,944.0 9,944 1

Merge Join (cost=6,293.91..6,293.95 rows=1 width=8) (actual time=5,219.612..5,795.591 rows=9,944 loops=1)

  • Merge Cond: (gel5.ganado_id = gf5.ganado_id)
  • Buffers: shared hit=97682
5. 138.133 2,003.062 ↓ 3,314.7 9,944 1

Sort (cost=2,743.94..2,743.95 rows=3 width=4) (actual time=1,931.740..2,003.062 rows=9,944 loops=1)

  • Sort Key: gel5.ganado_id
  • Sort Method: quicksort Memory: 851kB
  • Buffers: shared hit=30781
6. 363.739 1,864.929 ↓ 3,314.7 9,944 1

Nested Loop (cost=2,719.20..2,743.92 rows=3 width=4) (actual time=1,254.935..1,864.929 rows=9,944 loops=1)

  • Buffers: shared hit=30781
7. 181.484 1,322.198 ↓ 3,314.7 9,944 1

HashAggregate (cost=2,718.91..2,718.94 rows=3 width=8) (actual time=1,254.816..1,322.198 rows=9,944 loops=1)

  • Group Key: gel3.ganado_id
  • Buffers: shared hit=898
8. 203.891 1,140.714 ↓ 3,315.0 9,945 1

Hash Join (cost=2,126.49..2,718.90 rows=3 width=8) (actual time=841.578..1,140.714 rows=9,945 loops=1)

  • Hash Cond: ((gel.ganado_id = gel3.ganado_id) AND ((max(gel.created)) = gel3.created))
  • Buffers: shared hit=898
9. 321.043 533.823 ↓ 1.0 9,944 1

HashAggregate (cost=927.33..1,026.06 rows=9,873 width=12) (actual time=438.315..533.823 rows=9,944 loops=1)

  • Group Key: gel.ganado_id
  • Buffers: shared hit=449
10. 212.780 212.780 ↑ 1.0 27,183 1

Seq Scan on ganado_estado_leche gel (cost=0.00..791.41 rows=27,183 width=12) (actual time=0.124..212.780 rows=27,183 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 210
  • Buffers: shared hit=449
11. 199.490 403.000 ↑ 1.0 27,183 1

Hash (cost=791.41..791.41 rows=27,183 width=16) (actual time=403.000..403.000 rows=27,183 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1531kB
  • Buffers: shared hit=449
12. 203.510 203.510 ↑ 1.0 27,183 1

Seq Scan on ganado_estado_leche gel3 (cost=0.00..791.41 rows=27,183 width=16) (actual time=0.132..203.510 rows=27,183 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 210
  • Buffers: shared hit=449
13. 178.992 178.992 ↑ 1.0 1 9,944

Index Scan using ganado_estado_leche_pk on ganado_estado_leche gel5 (cost=0.29..8.30 rows=1 width=8) (actual time=0.012..0.018 rows=1 loops=9,944)

  • Index Cond: (ganado_estado_leche_id = (max(gel3.ganado_estado_leche_id)))
  • Buffers: shared hit=29883
14. 346.160 3,457.790 ↓ 10,944.5 21,889 1

Sort (cost=3,549.98..3,549.98 rows=2 width=4) (actual time=3,287.831..3,457.790 rows=21,889 loops=1)

  • Sort Key: gf5.ganado_id
  • Sort Method: quicksort Memory: 1795kB
  • Buffers: shared hit=66901
15. 964.724 3,111.630 ↓ 10,944.5 21,889 1

Nested Loop (cost=3,533.58..3,549.97 rows=2 width=4) (actual time=1,486.334..3,111.630 rows=21,889 loops=1)

  • Buffers: shared hit=66901
16. 337.895 1,665.348 ↓ 10,944.5 21,889 1

HashAggregate (cost=3,533.30..3,533.32 rows=2 width=8) (actual time=1,486.257..1,665.348 rows=21,889 loops=1)

  • Group Key: gf3.ganado_id
  • Buffers: shared hit=1116
17. 294.086 1,327.453 ↓ 10,944.5 21,889 1

Hash Join (cost=2,563.38..3,533.28 rows=2 width=8) (actual time=884.362..1,327.453 rows=21,889 loops=1)

  • Hash Cond: ((gf.ganado_id = gf3.ganado_id) AND ((max(gf.created)) = gf3.created))
  • Buffers: shared hit=1116
18. 382.661 599.225 ↓ 1.0 21,889 1

HashAggregate (cost=1,120.87..1,336.40 rows=21,553 width=12) (actual time=449.972..599.225 rows=21,889 loops=1)

  • Group Key: gf.ganado_id
  • Buffers: shared hit=558
19. 216.564 216.564 ↑ 1.0 31,847 1

Seq Scan on ganado_fundo gf (cost=0.00..960.05 rows=32,164 width=12) (actual time=0.340..216.564 rows=31,847 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Buffers: shared hit=558
20. 214.250 434.142 ↑ 1.0 31,847 1

Hash (cost=960.05..960.05 rows=32,164 width=16) (actual time=434.142..434.142 rows=31,847 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1749kB
  • Buffers: shared hit=558
21. 219.892 219.892 ↑ 1.0 31,847 1

Seq Scan on ganado_fundo gf3 (cost=0.00..960.05 rows=32,164 width=16) (actual time=0.178..219.892 rows=31,847 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Buffers: shared hit=558
22. 481.558 481.558 ↑ 1.0 1 21,889

Index Scan using ganado_fundo_pk on ganado_fundo gf5 (cost=0.29..8.30 rows=1 width=8) (actual time=0.015..0.022 rows=1 loops=21,889)

  • Index Cond: (ganado_fundo_id = (max(gf3.ganado_fundo_id)))
  • Buffers: shared hit=65785
23. 5,082,219.296 8,650,653.528 ↓ 3,470.5 13,882 9,944

Nested Loop (cost=8,798.01..8,831.08 rows=4 width=4) (actual time=0.309..869.937 rows=13,882 loops=9,944)

  • Buffers: shared hit=414916644, temp read=180 written=178
24. 943,245.698 945,624.680 ↓ 3,470.5 13,882 9,944

HashAggregate (cost=8,797.72..8,797.76 rows=4 width=8) (actual time=0.259..95.095 rows=13,882 loops=9,944)

  • Group Key: ger3.ganado_id
  • Buffers: shared hit=3244, temp read=180 written=178
25. 247.310 2,378.982 ↓ 3,472.0 13,888 1

Hash Join (cost=6,638.69..8,797.70 rows=4 width=8) (actual time=2,012.979..2,378.982 rows=13,888 loops=1)

  • Hash Cond: ((ger.ganado_id = ger3.ganado_id) AND ((max(ger.created)) = ger3.created))
  • Buffers: shared hit=3244, temp read=180 written=178
26. 675.596 1,230.002 ↓ 1.2 13,882 1

HashAggregate (cost=2,823.32..2,939.86 rows=11,654 width=12) (actual time=1,109.856..1,230.002 rows=13,882 loops=1)

  • Group Key: ger.ganado_id
  • Buffers: shared hit=1622
27. 554.406 554.406 ↑ 1.0 66,568 1

Seq Scan on ganado_estado_reproductivo ger (cost=0.00..2,490.29 rows=66,606 width=12) (actual time=0.246..554.406 rows=66,568 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 2895
  • Buffers: shared hit=1622
28. 455.145 901.670 ↑ 1.0 66,568 1

Hash (cost=2,490.29..2,490.29 rows=66,606 width=16) (actual time=901.670..901.670 rows=66,568 loops=1)

  • Buckets: 131072 Batches: 2 Memory Usage: 2582kB
  • Buffers: shared hit=1622, temp written=146
29. 446.525 446.525 ↑ 1.0 66,568 1

Seq Scan on ganado_estado_reproductivo ger3 (cost=0.00..2,490.29 rows=66,606 width=16) (actual time=0.695..446.525 rows=66,568 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 2895
  • Buffers: shared hit=1622
30. 2,622,809.552 2,622,809.552 ↑ 1.0 1 138,042,608

Index Scan using ganado_estado_reproductivo_pk on ganado_estado_reproductivo ger5 (cost=0.29..8.31 rows=1 width=8) (actual time=0.012..0.019 rows=1 loops=138,042,608)

  • Index Cond: (ganado_estado_reproductivo_id = (max(ger3.ganado_estado_reproductivo_id)))
  • Buffers: shared hit=414913400
31. 238.584 238.584 ↓ 0.0 0 9,941

Index Scan using ganado_pk on ganado g (cost=0.29..0.33 rows=1 width=4) (actual time=0.022..0.024 rows=0 loops=9,941)

  • Index Cond: (ganado_id = ger5.ganado_id)
  • Filter: (organizacion_id = 21)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=29875