explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ugry

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 0.253 ↓ 50.0 50 1

Limit (cost=28.94..28.96 rows=1 width=240) (actual time=0.201..0.253 rows=50 loops=1)

2.          

CTE recent_transfer_event

3. 0.030 0.094 ↑ 5.1 11 1

HashAggregate (cost=13.34..13.90 rows=56 width=64) (actual time=0.092..0.094 rows=11 loops=1)

  • Group Key: transfer_event.tenant_id, transfer_event.content_id
4. 0.064 0.064 ↑ 1.1 50 1

Index Scan using transfer_event_pkey on transfer_event (cost=0.44..12.92 rows=56 width=64) (actual time=0.008..0.064 rows=50 loops=1)

  • Index Cond: ((id > 0) AND (id <= 50))
5.          

CTE all_transfer_events

6. 0.037 0.225 ↓ 50.0 50 1

Hash Semi Join (cost=2.40..15.04 rows=1 width=157) (actual time=0.195..0.225 rows=50 loops=1)

  • Hash Cond: ((transfer_event_1.tenant_id = recent_transfer_event.tenant_id) AND (transfer_event_1.content_id = recent_transfer_event.content_id))
7. 0.063 0.063 ↑ 1.1 50 1

Index Scan using transfer_event_pkey on transfer_event transfer_event_1 (cost=0.44..12.78 rows=56 width=154) (actual time=0.055..0.063 rows=50 loops=1)

  • Index Cond: (id <= 50)
8. 0.025 0.125 ↑ 5.1 11 1

Hash (cost=1.12..1.12 rows=56 width=64) (actual time=0.125..0.125 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.100 0.100 ↑ 5.1 11 1

CTE Scan on recent_transfer_event (cost=0.00..1.12 rows=56 width=64) (actual time=0.094..0.100 rows=11 loops=1)

10. 0.247 0.247 ↓ 50.0 50 1

CTE Scan on all_transfer_events (cost=0.00..0.02 rows=1 width=240) (actual time=0.198..0.247 rows=50 loops=1)

Planning time : 842.952 ms
Execution time : 0.548 ms