explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RxnL

Settings
# exclusive inclusive rows x rows loops node
1. 1,671.175 8,537.332 ↑ 1.0 976,784 1

Sort (cost=1,397,333.83..1,399,775.79 rows=976,784 width=931) (actual time=8,272.734..8,537.332 rows=976,784 loops=1)

  • Sort Key: main_calculation.created_at DESC
  • Sort Method: external merge Disk: 507224kB
2. 1,292.163 6,866.157 ↑ 1.0 976,784 1

GroupAggregate (cost=570,255.36..899,520.65 rows=976,784 width=931) (actual time=2,960.546..6,866.157 rows=976,784 loops=1)

  • Group Key: main_calculation.id
3. 1,240.056 5,573.994 ↓ 1.0 3,604,870 1

Merge Left Join (cost=570,255.36..863,145.33 rows=3,547,665 width=923) (actual time=2,960.523..5,573.994 rows=3,604,870 loops=1)

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

Index Scan using "idx_457863_PRIMARY" on main_calculation (cost=0.42..237,233.46 rows=976,784 width=915) (actual time=0.027..605.735 rows=976,784 loops=1)

5. 1,551.346 3,728.203 ↓ 1.0 3,554,425 1

Sort (cost=570,254.93..579,124.09 rows=3,547,665 width=16) (actual time=2,960.489..3,728.203 rows=3,554,425 loops=1)

  • Sort Key: main_result.calculation_id
  • Sort Method: quicksort Memory: 264918kB
6. 733.703 2,176.857 ↓ 1.0 3,554,425 1

Hash Right Join (cost=157,358.46..184,296.68 rows=3,547,665 width=16) (actual time=1,397.345..2,176.857 rows=3,554,425 loops=1)

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

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

8. 722.357 1,383.191 ↑ 1.0 3,547,513 1

Hash (cost=113,012.65..113,012.65 rows=3,547,665 width=16) (actual time=1,383.191..1,383.191 rows=3,547,513 loops=1)

  • Buckets: 4194304 Batches: 1 Memory Usage: 199058kB
9. 660.834 660.834 ↑ 1.0 3,547,513 1

Seq Scan on main_result (cost=0.00..113,012.65 rows=3,547,665 width=16) (actual time=0.028..660.834 rows=3,547,513 loops=1)

Planning time : 0.591 ms
Execution time : 11,143.062 ms