explain.depesz.com

PostgreSQL's explain analyze made readable

Result: US23

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 6,081.550 ↑ 1.0 4 1

Limit (cost=58,514.60..58,514.61 rows=4 width=16) (actual time=6,081.547..6,081.550 rows=4 loops=1)

2.          

Initplan (for Limit)

3. 181.173 181.173 ↓ 1.0 1,589,188 1

Index Only Scan using research_outputs_16 on research_outputs (cost=0.56..58,056.79 rows=1,564,426 width=8) (actual time=0.047..181.173 rows=1,589,188 loops=1)

  • Index Cond: (output_type = 'book'::text)
  • Heap Fetches: 0
4. 341.450 6,081.546 ↑ 1,537.5 4 1

Sort (cost=457.82..473.19 rows=6,150 width=16) (actual time=6,081.545..6,081.546 rows=4 loops=1)

  • Sort Key: mentions.posted_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
5. 2,433.166 5,740.096 ↓ 765.8 4,709,861 1

HashAggregate (cost=304.06..365.56 rows=6,150 width=16) (actual time=4,816.416..5,740.096 rows=4,709,861 loops=1)

  • Group Key: mentions.posted_at, mentions.post_id
6. 3,306.930 3,306.930 ↓ 801.0 4,926,964 1

Index Only Scan using mentions_11 on mentions (cost=0.57..273.31 rows=6,151 width=16) (actual time=270.058..3,306.930 rows=4,926,964 loops=1)

  • Index Cond: (research_output_id = ANY ($0))
  • Heap Fetches: 0
Planning time : 1.438 ms
Execution time : 6,104.557 ms