explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P7CL

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

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

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

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

  • Group Key: main_calculation.id
3. 1,297.153 7,659.039 ↓ 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,271.233..7,659.039 rows=3,604,870 loops=1)

  • Merge Cond: (main_calculation.id = main_result.calculation_id)
4. 618.851 618.851 ↑ 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.007..618.851 rows=976,784 loops=1)

5. 429.606 5,743.035 ↓ 1.0 3,554,425 1

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

6. 2,988.295 5,313.429 ↓ 1.0 3,554,425 1

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

  • Sort Key: main_result.calculation_id
  • Sort Method: external merge Disk: 65496kB
7. 965.112 2,325.134 ↓ 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,282.665..2,325.134 rows=3,554,425 loops=1)

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

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

9. 589.113 1,282.062 ↑ 1.0 3,547,513 1

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

  • Buckets: 131072 Batches: 64 Memory Usage: 3616kB
10. 692.949 692.949 ↑ 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.014..692.949 rows=3,547,513 loops=1)

Planning time : 1.363 ms
Execution time : 14,208.709 ms