explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FQQr

Settings
# exclusive inclusive rows x rows loops node
1. 1.846 30,348.280 ↓ 0.0 0 1

Update on cdr_event (cost=16,885,125.67..16,885,359.03 rows=5,834 width=308) (actual time=30,348.280..30,348.280 rows=0 loops=1)

2.          

CTE newer_alert_events

3. 69.999 30,342.263 ↑ 142.3 41 1

HashAggregate (cost=16,883,520.81..16,883,579.15 rows=5,834 width=16) (actual time=30,342.241..30,342.263 rows=41 loops=1)

4. 29.527 30,272.264 ↑ 76.5 175,300 1

Nested Loop Left Join (cost=0.57..16,782,893.36 rows=13,416,993 width=16) (actual time=0.977..30,272.264 rows=175,300 loops=1)

5. 2.803 2.803 ↓ 1.0 2,239 1

Seq Scan on cdr_event cdr_event_1 (cost=0.00..1,523.62 rows=2,197 width=24) (actual time=0.018..2.803 rows=2,239 loops=1)

  • Filter: (state = 'active'::text)
  • Rows Removed by Filter: 37
6. 30,239.934 30,239.934 ↑ 185.5 77 2,239

Index Scan using index_alert_event_on_adid_and_created_at_and_not_summary on alert_event (cost=0.57..7,495.46 rows=14,285 width=16) (actual time=0.009..13.506 rows=77 loops=2,239)

  • Index Cond: ((cdr_event_1.cdr_alert_id = alert_definition_id) AND (created_at > COALESCE(cdr_event_1.last_active_at, cdr_event_1.created_at)))
7. 0.056 30,346.434 ↑ 145.8 40 1

Hash Join (cost=1,546.53..1,779.89 rows=5,834 width=308) (actual time=30,346.360..30,346.434 rows=40 loops=1)

  • Hash Cond: (newer_alert_events.alert_definition_id = cdr_event.cdr_alert_id)
8. 30,342.313 30,342.313 ↑ 142.3 41 1

CTE Scan on newer_alert_events (cost=0.00..116.68 rows=5,834 width=72) (actual time=30,342.267..30,342.313 rows=41 loops=1)

9. 1.594 4.065 ↑ 1.2 1,854 1

Hash (cost=1,517.90..1,517.90 rows=2,290 width=244) (actual time=4.065..4.065 rows=1,854 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1138kB
10. 2.471 2.471 ↑ 1.0 2,276 1

Seq Scan on cdr_event (cost=0.00..1,517.90 rows=2,290 width=244) (actual time=0.016..2.471 rows=2,276 loops=1)