explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lXrx

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 4,258.125 ↑ 1.0 10 1

Limit (cost=324,806.48..324,806.60 rows=10 width=67) (actual time=4,258.119..4,258.125 rows=10 loops=1)

2. 0.004 4,258.123 ↑ 35,023.2 10 1

Unique (cost=324,806.48..329,184.38 rows=350,232 width=67) (actual time=4,258.119..4,258.123 rows=10 loops=1)

3. 218.433 4,258.119 ↑ 35,023.2 10 1

Sort (cost=324,806.48..325,682.06 rows=350,232 width=67) (actual time=4,258.118..4,258.119 rows=10 loops=1)

  • Sort Key: ji.id, jia.status, jia.attempt, ji.source
  • Sort Method: external sort Disk: 27360kB
4. 402.883 4,039.686 ↓ 1.0 356,726 1

Group (cost=254,187.32..263,818.70 rows=350,232 width=67) (actual time=3,550.371..4,039.686 rows=356,726 loops=1)

5. 426.380 3,636.803 ↓ 1.0 356,726 1

Sort (cost=254,187.32..255,062.90 rows=350,232 width=67) (actual time=3,550.339..3,636.803 rows=356,726 loops=1)

  • Sort Key: ji.id, jia.status, jia.attempt, ji.job_name, ji.odate
  • Sort Method: external merge Disk: 19552kB
6. 1,576.242 3,210.423 ↓ 1.0 356,726 1

Hash Join (cost=173,470.21..193,199.54 rows=350,232 width=67) (actual time=1,531.909..3,210.423 rows=356,726 loops=1)

  • Hash Cond: (jia.job_instance_id = ji.id)
7. 37.590 1,439.213 ↓ 1.0 356,726 1

Subquery Scan on jia (cost=156,772.64..162,026.12 rows=350,232 width=40) (actual time=1,318.081..1,439.213 rows=356,726 loops=1)

8. 42.415 1,401.623 ↓ 1.0 356,726 1

Unique (cost=156,772.64..158,523.80 rows=350,232 width=16) (actual time=1,318.079..1,401.623 rows=356,726 loops=1)

9. 526.498 1,359.208 ↓ 1.0 361,629 1

Sort (cost=156,772.64..157,648.22 rows=350,232 width=16) (actual time=1,318.078..1,359.208 rows=361,629 loops=1)

  • Sort Key: job_instance_attempts.job_instance_id, (max(job_instance_attempts.attempt_number))
  • Sort Method: external sort Disk: 14840kB
10. 219.160 832.710 ↓ 1.0 361,629 1

WindowAgg (cost=105,538.22..112,542.86 rows=350,232 width=16) (actual time=569.718..832.710 rows=361,629 loops=1)

11. 216.433 613.550 ↓ 1.0 361,629 1

Sort (cost=105,538.22..106,413.80 rows=350,232 width=16) (actual time=569.708..613.550 rows=361,629 loops=1)

  • Sort Key: job_instance_attempts.job_instance_id, job_instance_attempts.attempt_number
  • Sort Method: external sort Disk: 12000kB
12. 107.037 397.117 ↓ 1.0 361,629 1

GroupAggregate (cost=53,289.90..61,308.44 rows=350,232 width=16) (actual time=233.379..397.117 rows=361,629 loops=1)

13. 234.443 290.080 ↓ 1.0 361,630 1

Sort (cost=53,289.90..54,193.14 rows=361,298 width=16) (actual time=233.371..290.080 rows=361,630 loops=1)

  • Sort Key: job_instance_attempts.job_instance_id, job_instance_attempts.status, job_instance_attempts.attempt_number
  • Sort Method: external merge Disk: 10584kB
14. 55.637 55.637 ↓ 1.0 361,630 1

Seq Scan on job_instance_attempts (cost=0.00..7,581.98 rows=361,298 width=16) (actual time=0.006..55.637 rows=361,630 loops=1)

15. 115.322 194.968 ↓ 1.0 356,726 1

Hash (cost=9,810.03..9,810.03 rows=356,203 width=31) (actual time=194.968..194.968 rows=356,726 loops=1)

  • Buckets: 2048 Batches: 32 Memory Usage: 690kB
16. 79.646 79.646 ↓ 1.0 356,726 1

Seq Scan on job_instances ji (cost=0.00..9,810.03 rows=356,203 width=31) (actual time=0.014..79.646 rows=356,726 loops=1)

Total runtime : 9,128.995 ms