explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 725du

Settings
# exclusive inclusive rows x rows loops node
1. 2,375.230 11,243.261 ↑ 1.0 976,784 1

Sort (cost=1,830,843.03..1,833,284.99 rows=976,784 width=773) (actual time=10,901.230..11,243.261 rows=976,784 loops=1)

  • Sort Key: main_calculation.created_at DESC
  • Sort Method: external merge Disk: 507232kB
2. 1,281.544 8,868.031 ↑ 1.0 976,784 1

GroupAggregate (cost=729,826.30..1,065,934.36 rows=976,784 width=773) (actual time=4,177.646..8,868.031 rows=976,784 loops=1)

  • Group Key: main_calculation.id
3. 1,300.643 7,586.487 ↓ 1.0 3,604,870 1

Merge Left Join (cost=729,826.30..1,029,560.17 rows=3,547,513 width=765) (actual time=4,177.632..7,586.487 rows=3,604,870 loops=1)

  • Merge Cond: (main_calculation.id = main_result.calculation_id)
4. 627.858 627.858 ↑ 1.0 976,784 1

Index Scan using "idx_457863_PRIMARY" on main_calculation (cost=0.42..235,210.85 rows=976,784 width=757) (actual time=0.009..627.858 rows=976,784 loops=1)

5. 431.915 5,657.986 ↓ 1.0 3,554,425 1

Materialize (cost=729,825.88..747,563.44 rows=3,547,513 width=16) (actual time=4,177.616..5,657.986 rows=3,554,425 loops=1)

6. 2,959.525 5,226.071 ↓ 1.0 3,554,425 1

Sort (cost=729,825.88..738,694.66 rows=3,547,513 width=16) (actual time=4,177.614..5,226.071 rows=3,554,425 loops=1)

  • Sort Key: main_result.calculation_id
  • Sort Method: external merge Disk: 65496kB
7. 898.793 2,266.546 ↓ 1.0 3,554,425 1

Hash Right Join (cost=174,677.04..222,631.26 rows=3,547,513 width=16) (actual time=1,293.477..2,266.546 rows=3,554,425 loops=1)

  • Hash Cond: (policy_agreement.result_id = main_result.id)
8. 74.953 74.953 ↑ 1.0 378,117 1

Seq Scan on policy_agreement (cost=0.00..20,321.17 rows=378,117 width=16) (actual time=0.021..74.953 rows=378,117 loops=1)

9. 590.815 1,292.800 ↑ 1.0 3,547,513 1

Hash (cost=113,011.13..113,011.13 rows=3,547,513 width=16) (actual time=1,292.800..1,292.800 rows=3,547,513 loops=1)

  • Buckets: 131072 Batches: 64 Memory Usage: 3616kB
10. 701.985 701.985 ↑ 1.0 3,547,513 1

Seq Scan on main_result (cost=0.00..113,011.13 rows=3,547,513 width=16) (actual time=0.015..701.985 rows=3,547,513 loops=1)

Planning time : 0.668 ms
Execution time : 14,170.282 ms