explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sABI : better quick plan

Settings
# exclusive inclusive rows x rows loops node
1. 0.076 31.390 ↑ 1.0 30 1

Sort (cost=9,908.86..9,908.93 rows=30 width=565) (actual time=31.386..31.390 rows=30 loops=1)

  • Sort Key: "Job".created_at DESC, job_statuses.message_number, job_statuses.created_at
  • Sort Method: quicksort Memory: 55kB
2. 0.030 31.314 ↑ 1.0 30 1

Nested Loop Left Join (cost=104.89..9,908.12 rows=30 width=565) (actual time=2.040..31.314 rows=30 loops=1)

3. 3.343 31.224 ↑ 1.0 30 1

Merge Left Join (cost=104.75..9,903.00 rows=30 width=396) (actual time=2.034..31.224 rows=30 loops=1)

  • Merge Cond: (("Job".id)::text = (job_statuses.job_id)::text)
4. 0.090 0.439 ↑ 1.0 30 1

Sort (cost=104.33..104.41 rows=30 width=355) (actual time=0.431..0.439 rows=30 loops=1)

  • Sort Key: "Job".id
  • Sort Method: quicksort Memory: 46kB
5. 0.026 0.349 ↑ 1.0 30 1

Nested Loop (cost=0.86..103.60 rows=30 width=355) (actual time=0.043..0.349 rows=30 loops=1)

6. 0.017 0.023 ↑ 1.0 30 1

HashAggregate (cost=0.45..0.75 rows=30 width=32) (actual time=0.018..0.023 rows=30 loops=1)

  • Group Key: "*VALUES*".column1
7. 0.006 0.006 ↑ 1.0 30 1

Values Scan on "*VALUES*" (cost=0.00..0.38 rows=30 width=32) (actual time=0.002..0.006 rows=30 loops=1)

8. 0.300 0.300 ↑ 1.0 1 30

Index Scan using jobs_pkey on jobs "Job" (cost=0.41..3.43 rows=1 width=355) (actual time=0.010..0.010 rows=1 loops=30)

  • Index Cond: ((id)::text = "*VALUES*".column1)
9. 3.351 27.442 ↑ 1.2 7,177 1

Unique (cost=0.41..9,692.52 rows=8,456 width=112) (actual time=0.011..27.442 rows=7,177 loops=1)

10. 24.091 24.091 ↑ 1.2 32,535 1

Index Scan using jobs_statuses_laststatus_idx on job_statuses (cost=0.41..9,598.37 rows=37,659 width=112) (actual time=0.009..24.091 rows=32,535 loops=1)

11. 0.060 0.060 ↑ 1.0 1 30

Index Scan using profiles_pkey on profiles profile (cost=0.14..0.17 rows=1 width=45) (actual time=0.002..0.002 rows=1 loops=30)

  • Index Cond: ("Job".profile_id = id)
Planning time : 0.500 ms
Execution time : 31.490 ms