explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iS1q : g

Settings
# exclusive inclusive rows x rows loops node
1. 0.037 0.237 ↓ 2.0 2 1

WindowAgg (cost=12.69..12.72 rows=1 width=136) (actual time=0.213..0.237 rows=2 loops=1)

2. 0.031 0.200 ↓ 2.0 2 1

Sort (cost=12.69..12.69 rows=1 width=181) (actual time=0.187..0.200 rows=2 loops=1)

  • Sort Key: ((e.data ->> 'start_date'::text))
  • Sort Method: quicksort Memory: 25kB
3. 0.033 0.169 ↓ 2.0 2 1

GroupAggregate (cost=12.65..12.68 rows=1 width=181) (actual time=0.146..0.169 rows=2 loops=1)

  • Group Key: p.id, ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
4. 0.034 0.136 ↓ 2.0 2 1

Sort (cost=12.65..12.65 rows=1 width=173) (actual time=0.123..0.136 rows=2 loops=1)

  • Sort Key: ((e.data ->> 'stage'::text)), ((e.data ->> 'start_date'::text))
  • Sort Method: quicksort Memory: 25kB
5. 0.034 0.102 ↓ 2.0 2 1

Nested Loop (cost=0.15..12.64 rows=1 width=173) (actual time=0.044..0.102 rows=2 loops=1)

6. 0.023 0.023 ↑ 1.0 1 1

Index Scan using plants_pkey on plants p (cost=0.15..8.17 rows=1 width=32) (actual time=0.014..0.023 rows=1 loops=1)

  • Index Cond: (id = '1ce2bc84-6821-42ca-8bab-470c8eaa2b59'::uuid)
7. 0.045 0.045 ↓ 2.0 2 1

Seq Scan on events e (cost=0.00..4.45 rows=1 width=93) (actual time=0.015..0.045 rows=2 loops=1)

  • Filter: (((name)::text = ANY ('{plant.stage_created,plant.stage_updated}'::text[])) AND (eventable_id = '1ce2bc84-6821-42ca-8bab-470c8eaa2b59'::uuid) AND ((eventable_type)::text = 'Plant'::text))
  • Rows Removed by Filter: 82
Planning time : 0.226 ms
Execution time : 0.361 ms