explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4Duz

Settings
# exclusive inclusive rows x rows loops node
1. 0.052 1,012.562 ↑ 1.0 5 1

Sort (cost=201,217.65..201,217.66 rows=5 width=29) (actual time=1,012.561..1,012.562 rows=5 loops=1)

  • Sort Key: tt.name DESC
  • Sort Method: quicksort Memory: 25kB
2. 17.236 1,012.510 ↑ 1.0 5 1

GroupAggregate (cost=201,197.18..201,217.59 rows=5 width=29) (actual time=989.653..1,012.510 rows=5 loops=1)

  • Group Key: tt.id
3. 35.067 995.274 ↓ 22.0 35,771 1

Sort (cost=201,197.18..201,201.25 rows=1,629 width=33) (actual time=988.396..995.274 rows=35,771 loops=1)

  • Sort Key: tt.id
  • Sort Method: quicksort Memory: 3613kB
4. 54.300 960.207 ↓ 22.0 35,771 1

Nested Loop Left Join (cost=1,005.59..201,110.27 rows=1,629 width=33) (actual time=1.607..960.207 rows=35,771 loops=1)

5. 1.082 593.202 ↓ 21.3 34,745 1

Hash Right Join (cost=1,005.16..196,130.82 rows=1,629 width=29) (actual time=1.558..593.202 rows=34,745 loops=1)

  • Hash Cond: (t.task_type_id = tt.id)
6. 0.000 592.015 ↑ 1.2 34,744 1

Gather (cost=1,000.00..196,011.71 rows=42,030 width=12) (actual time=1.392..592.015 rows=34,744 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 810.777 810.777 ↑ 1.5 11,581 3

Parallel Seq Scan on tasks t (cost=0.00..190,808.71 rows=17,512 width=12) (actual time=0.080..810.777 rows=11,581 loops=3)

  • Filter: ((deleted_on IS NULL) AND (deleted_by IS NULL) AND (task_status_id <> ALL ('{6,7}'::integer[])) AND CASE WHEN (task_type_id = 96) THEN (user_id = 1868) ELSE true END AND (task_type_id = ANY ('{96,61,6,7,5}'::integer[])))
  • Rows Removed by Filter: 499635
8. 0.011 0.105 ↑ 1.0 5 1

Hash (cost=5.10..5.10 rows=5 width=21) (actual time=0.105..0.105 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.094 0.094 ↑ 1.0 5 1

Seq Scan on task_types tt (cost=0.00..5.10 rows=5 width=21) (actual time=0.021..0.094 rows=5 loops=1)

  • Filter: (id = ANY ('{96,61,6,7,5}'::integer[]))
  • Rows Removed by Filter: 124
10. 312.705 312.705 ↓ 0.0 0 34,745

Index Scan using idx_task_companies_task_id on task_companies tc (cost=0.43..3.04 rows=2 width=8) (actual time=0.008..0.009 rows=0 loops=34,745)

  • Index Cond: (t.id = task_id)
  • Filter: (task_note_id IS NULL)
  • Rows Removed by Filter: 1