explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QRP2

Settings
# exclusive inclusive rows x rows loops node
1. 2,266.251 2,266.251 ↑ 1.0 124,631 1

CTE Scan on t (cost=1,314,344.98..1,316,838.18 rows=124,660 width=307) (actual time=1,982.755..2,266.251 rows=124,631 loops=1)

2.          

CTE t

3. 464.932 2,071.218 ↑ 1.0 124,631 1

Sort (cost=1,314,033.33..1,314,344.98 rows=124,660 width=828) (actual time=1,982.751..2,071.218 rows=124,631 loops=1)

  • Sort Key: feed.added_at DESC, feed.is_prioritized DESC
  • Sort Method: external merge Disk: 92720kB
4. 245.965 1,606.286 ↑ 1.0 124,631 1

WindowAgg (cost=0.42..1,212,300.33 rows=124,660 width=828) (actual time=0.050..1,606.286 rows=124,631 loops=1)

5. 213.024 612.535 ↑ 1.0 124,631 1

Group (cost=0.42..1,064,889.88 rows=124,660 width=824) (actual time=0.027..612.535 rows=124,631 loops=1)

  • Group Key: feed.id
6. 150.249 150.249 ↑ 1.0 124,631 1

Index Scan using feed_pkey on feed (cost=0.42..28,653.63 rows=124,660 width=788) (actual time=0.013..150.249 rows=124,631 loops=1)

  • Filter: ((NOT is_pinned) AND (NOT is_deleted))
  • Rows Removed by Filter: 32
7.          

SubPlan (forGroup)

8. 249.262 249.262 ↑ 1.0 1 124,631

Index Scan using feed_calculated_rating_feed_id_key on feed_calculated_rating (cost=0.29..8.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=124,631)

  • Index Cond: (feed_id = feed.id)
9.          

SubPlan (forWindowAgg)

10. 124.631 747.786 ↑ 1.0 1 124,631

Aggregate (cost=1.15..1.16 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=124,631)

11. 249.262 623.155 ↓ 0.0 0 124,631

Sort (cost=1.13..1.13 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=124,631)

  • Sort Key: (count(ffs.*)) DESC
  • Sort Method: quicksort Memory: 25kB
12. 0.000 373.893 ↓ 0.0 0 124,631

HashAggregate (cost=1.11..1.12 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=124,631)

  • Group Key: ffs.type
13. 373.893 373.893 ↓ 0.0 0 124,631

Seq Scan on feed_feedback ffs (cost=0.00..1.10 rows=1 width=68) (actual time=0.003..0.003 rows=0 loops=124,631)

  • Filter: (feed_id = feed.id)
  • Rows Removed by Filter: 17
Planning time : 0.522 ms
Execution time : 2,322.288 ms