explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C6Dk

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.443 10.036 ↑ 1.0 1 1

Aggregate (cost=2,503.73..2,503.74 rows=1 width=16) (actual time=10.036..10.036 rows=1 loops=1)

2. 4.012 9.593 ↓ 2.7 1,011 1

Hash Right Join (cost=1,380.70..2,500.04 rows=369 width=26) (actual time=1.254..9.593 rows=1,011 loops=1)

  • Hash Cond: (st.task_id = t.id)
  • Filter: (((t.state)::text = 'completed'::text) OR ((st.state)::text = 'completed'::text))
  • Rows Removed by Filter: 34
3. 4.413 4.413 ↑ 1.0 23,882 1

Seq Scan on sub_tasks st (cost=0.00..1,027.82 rows=23,982 width=17) (actual time=0.010..4.413 rows=23,882 loops=1)

4. 0.063 1.168 ↑ 1.1 381 1

Hash (cost=1,375.63..1,375.63 rows=405 width=13) (actual time=1.168..1.168 rows=381 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
5. 1.036 1.105 ↑ 1.1 381 1

Bitmap Heap Scan on tasks t (cost=11.43..1,375.63 rows=405 width=13) (actual time=0.130..1.105 rows=381 loops=1)

  • Recheck Cond: (contractor_id = 6701)
  • Heap Blocks: exact=459
6. 0.069 0.069 ↓ 1.2 486 1

Bitmap Index Scan on index_tasks_on_contractor_id (cost=0.00..11.33 rows=405 width=0) (actual time=0.069..0.069 rows=486 loops=1)

  • Index Cond: (contractor_id = 6701)