explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WwQ5 : Optimization for: plan #6pZU

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 3.253 45.428 ↑ 1.8 26 1

GroupAggregate (cost=2,260.64..2,261.68 rows=46 width=28) (actual time=41.230..45.428 rows=26 loops=1)

  • Group Key: email_history.object_id
2. 5.033 42.175 ↓ 260.4 11,978 1

Sort (cost=2,260.64..2,260.76 rows=46 width=6) (actual time=41.205..42.175 rows=11,978 loops=1)

  • Sort Key: email_history.object_id
  • Sort Method: quicksort Memory: 946kB
3. 6.436 37.142 ↓ 260.4 11,978 1

Nested Loop (cost=0.56..2,259.37 rows=46 width=6) (actual time=1.784..37.142 rows=11,978 loops=1)

4. 7.186 7.186 ↓ 1.2 42 1

Seq Scan on hub_auto_messages (cost=0.00..1,848.90 rows=36 width=4) (actual time=0.145..7.186 rows=42 loops=1)

  • Filter: ((hub_id = 92) OR is_default)
  • Rows Removed by Filter: 4384
5. 23.520 23.520 ↓ 142.5 285 42

Index Scan using email_history_object_type_id_hub_idx on email_history (cost=0.56..11.38 rows=2 width=6) (actual time=0.025..0.560 rows=285 loops=42)

  • Index Cond: ((object_type = 'HubAutoMessage'::text) AND (object_id = hub_auto_messages.id) AND (hub_id = 92))
Planning time : 3.062 ms
Execution time : 45.595 ms