explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iFQj : b

Settings
# exclusive inclusive rows x rows loops node
1. 0.122 1.234 ↓ 2.0 2 1

GroupAggregate (cost=15.78..15.81 rows=1 width=88) (actual time=1.202..1.234 rows=2 loops=1)

  • Group Key: p.batch_id, ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
2. 0.193 1.112 ↓ 15.0 15 1

Sort (cost=15.78..15.78 rows=1 width=80) (actual time=1.022..1.112 rows=15 loops=1)

  • Sort Key: ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
  • Sort Method: quicksort Memory: 26kB
3. 0.340 0.919 ↓ 15.0 15 1

Hash Join (cost=11.33..15.77 rows=1 width=80) (actual time=0.292..0.919 rows=15 loops=1)

  • Hash Cond: ((e.eventable_id = p.id) AND ((e.data ->> 'stage'::text) = (p.stage)::text))
4. 0.343 0.343 ↓ 1.2 41 1

Seq Scan on events e (cost=0.00..4.25 rows=34 width=93) (actual time=0.023..0.343 rows=41 loops=1)

  • Filter: (((name)::text = ANY ('{plant.stage_created,plant.stage_updated}'::text[])) AND ((eventable_type)::text = 'Plant'::text))
  • Rows Removed by Filter: 43
5. 0.122 0.236 ↓ 5.0 15 1

Hash (cost=11.28..11.28 rows=3 width=36) (actual time=0.230..0.236 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.095 0.114 ↓ 5.0 15 1

Bitmap Heap Scan on plants p (cost=4.17..11.28 rows=3 width=36) (actual time=0.031..0.114 rows=15 loops=1)

  • Recheck Cond: (batch_id = 'ba1c0001-29a3-477d-b522-ae24180754cd'::uuid)
  • Heap Blocks: exact=1
7. 0.019 0.019 ↓ 5.0 15 1

Bitmap Index Scan on index_plants_on_batch_id_and_serial_number (cost=0.00..4.17 rows=3 width=0) (actual time=0.013..0.019 rows=15 loops=1)

  • Index Cond: (batch_id = 'ba1c0001-29a3-477d-b522-ae24180754cd'::uuid)
Planning time : 0.326 ms
Execution time : 1.423 ms