explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3mmy

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=2,743,580.18..2,743,580.24 rows=25 width=278) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=2,743,580.18..2,790,949.23 rows=18,947,620 width=278) (actual rows= loops=)

  • Sort Key: eventlog.event_timestamp DESC NULLS LAST
3. 0.000 0.000 ↓ 0.0

Hash Join (cost=15.52..2,208,891.96 rows=18,947,620 width=278) (actual rows= loops=)

  • Hash Cond: (eventlog.event_id = eventcode.event_id)
4. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1.74..1,948,348.40 rows=18,947,620 width=233) (actual rows= loops=)

  • Merge Cond: (eventlog.event_log_id = rdsconnectionreason.event_log_id)
5. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1.59..1,900,968.92 rows=18,947,620 width=224) (actual rows= loops=)

  • Merge Cond: (eventlog.event_log_id = eventtimeduration.event_log_id)
6. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=1.31..1,853,391.95 rows=18,947,620 width=189) (actual rows= loops=)

  • Merge Cond: (eventlog.event_log_id = customereventlog.event_log_id)
7. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=0.87..1,135,746.53 rows=18,947,620 width=181) (actual rows= loops=)

  • Merge Cond: (eventlog.event_log_id = resourceeventlogrel.event_log_id)
8. 0.000 0.000 ↓ 0.0

Index Scan using eventlog_pk on eventlog (cost=0.44..1,087,751.25 rows=18,947,620 width=136) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Materialize (cost=0.43..624.10 rows=170 width=53) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.43..623.68 rows=170 width=53) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using resourceeventlogrel_fk3_idx on resourceeventlogrel (cost=0.14..9.70 rows=170 width=34) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using resource_pk on resource (cost=0.29..3.60 rows=1 width=27) (actual rows= loops=)

  • Index Cond: (resourceeventlogrel.resource_id = resource_id)
13. 0.000 0.000 ↓ 0.0

Index Scan using customereventlog_fk1_idx on customereventlog (cost=0.44..454,372.15 rows=17,293,306 width=16) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using eventtimeduration_fk3_idx on eventtimeduration (cost=0.28..145.59 rows=5,019 width=43) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using rdsconnectionreason_fk1_idx on rdsconnectionreason (cost=0.14..8.48 rows=156 width=17) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash (cost=9.46..9.46 rows=346 width=49) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on eventcode (cost=0.00..9.46 rows=346 width=49) (actual rows= loops=)