explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7uFz : b2

Settings
# exclusive inclusive rows x rows loops node
1. 0.095 1.446 ↓ 2.0 2 1

GroupAggregate (cost=15.71..15.73 rows=1 width=72) (actual time=1.424..1.446 rows=2 loops=1)

  • Group Key: x.stage, x.start_date
2. 0.158 1.351 ↓ 16.0 16 1

Sort (cost=15.71..15.71 rows=1 width=64) (actual time=1.277..1.351 rows=16 loops=1)

  • Sort Key: x.stage, x.start_date
  • Sort Method: quicksort Memory: 26kB
3. 0.149 1.193 ↓ 16.0 16 1

Subquery Scan on x (cost=15.67..15.70 rows=1 width=64) (actual time=0.793..1.193 rows=16 loops=1)

4. 0.197 1.044 ↓ 16.0 16 1

Group (cost=15.67..15.69 rows=1 width=128) (actual time=0.784..1.044 rows=16 loops=1)

  • Group Key: p.id, ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
5. 0.185 0.847 ↓ 16.0 16 1

Sort (cost=15.67..15.67 rows=1 width=96) (actual time=0.774..0.847 rows=16 loops=1)

  • Sort Key: p.id, ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
  • Sort Method: quicksort Memory: 27kB
6. 0.275 0.662 ↓ 16.0 16 1

Hash Join (cost=11.32..15.66 rows=1 width=96) (actual time=0.201..0.662 rows=16 loops=1)

  • Hash Cond: (e.eventable_id = p.id)
7. 0.215 0.215 ↓ 1.2 41 1

Seq Scan on events e (cost=0.00..4.25 rows=34 width=93) (actual time=0.014..0.215 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
8. 0.082 0.172 ↓ 5.0 15 1

Hash (cost=11.28..11.28 rows=3 width=32) (actual time=0.167..0.172 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.080 0.090 ↓ 5.0 15 1

Bitmap Heap Scan on plants p (cost=4.17..11.28 rows=3 width=32) (actual time=0.019..0.090 rows=15 loops=1)

  • Recheck Cond: (batch_id = 'ba1c0001-29a3-477d-b522-ae24180754cd'::uuid)
  • Heap Blocks: exact=1
10. 0.010 0.010 ↓ 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.005..0.010 rows=15 loops=1)

  • Index Cond: (batch_id = 'ba1c0001-29a3-477d-b522-ae24180754cd'::uuid)