explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zcGW : quick query

Settings
# exclusive inclusive rows x rows loops node
1. 0.133 56.550 ↑ 1.0 30 1

Sort (cost=9,908.86..9,908.93 rows=30 width=565) (actual time=56.545..56.550 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.242 56.417 ↑ 1.0 30 1

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

  • -> Index Scan using profiles_pkey on profiles profile (cost=0.14..0.17 rows=1 width=45) (actual time=0.005..0.005 rows=1 loops=
3. 6.364 56.175 ↑ 1.0 30 1

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

  • Merge Cond: (("Job".id)::text = (job_statuses.job_id)::text)
  • Index Cond: ("Job".profile_id = id)
4. 0.154 0.761 ↑ 1.0 30 1

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

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

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

  • -> Index Scan using jobs_pkey on jobs "Job" (cost=0.41..3.43 rows=1 width=355) (actual time=0.017..0.017 rows
6. 0.044 0.044 ↑ 1.0 30 1

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

  • Group Key: "*VALUES*".column1
  • -> Values Scan on "*VALUES*" (cost=0.00..0.38 rows=30 width=32) (actual time=0.002..0.011 rows=30 loops
  • Index Cond: ((id)::text = "*VALUES*".column1)
7. 49.050 49.050 ↑ 1.2 7,177 1

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

  • -> Index Scan using jobs_statuses_laststatus_idx on job_statuses (cost=0.41..9598.37 rows=37659 width=112) (actual