explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GWIv

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 556.080 ↑ 1.0 40 1

Limit (cost=754,198.26..754,199.06 rows=40 width=371) (actual time=555.140..556.080 rows=40 loops=1)

2.          

CTE t

3. 0.674 555.930 ↑ 1,879.3 40 1

WindowAgg (cost=647,455.44..754,198.26 rows=75,171 width=1,145) (actual time=555.080..555.930 rows=40 loops=1)

4. 0.103 555.016 ↑ 1,879.3 40 1

Group (cost=647,455.44..651,026.06 rows=75,171 width=1,041) (actual time=554.906..555.016 rows=40 loops=1)

  • Group Key: feed_1.added_at, feed_1.is_prioritized, feed_1.id, feed_1.title, feed_1.text, feed_1.uri, feed_1.uri_hash, feed_1.source_publication_date, feed_1.publication_date, feed_1.is_pinned, feed_1.is_deleted, feed_1.related_entities, feed_1.image_uri, feed_1.clean_text, feed_1.updated_at, ((SubPlan 2)), (ROW(feed_source.id, feed_source.name, feed_source.source_type_id, feed_source.added_at, feed_source.updated_at, feed_source.title, feed_source.description, feed_source.image_uri, feed_source.website_uri, feed_source.is_official, feed_source.is_active, feed_source.last_use, feed_source.owner_id, feed_source.owner_type, feed_source_category.id, feed_source_category.name, feed_source_class.id, feed_source_class.name)), feed_source_type.*
5. 145.900 554.913 ↑ 1,879.3 40 1

Sort (cost=647,455.44..647,643.37 rows=75,171 width=1,041) (actual time=554.902..554.913 rows=40 loops=1)

  • Sort Key: feed_1.added_at DESC, feed_1.is_prioritized DESC, feed_1.id, feed_1.title, feed_1.text, feed_1.uri, feed_1.uri_hash, feed_1.source_publication_date, feed_1.publication_date, feed_1.is_pinned, feed_1.is_deleted, feed_1.related_entities, feed_1.image_uri, feed_1.clean_text, feed_1.updated_at, ((SubPlan 2)), (ROW(feed_source.id, feed_source.name, feed_source.source_type_id, feed_source.added_at, feed_source.updated_at, feed_source.title, feed_source.description, feed_source.image_uri, feed_source.website_uri, feed_source.is_official, feed_source.is_active, feed_source.last_use, feed_source.owner_id, feed_source.owner_type, feed_source_category.id, feed_source_category.name, feed_source_class.id, feed_source_class.name)), feed_source_type.*
  • Sort Method: quicksort Memory: 129477kB
6. 40.601 409.013 ↑ 1.0 73,163 1

Hash Left Join (cost=14,159.35..641,367.38 rows=75,171 width=1,041) (actual time=138.196..409.013 rows=73,163 loops=1)

  • Hash Cond: (feed_1.source_id = feed_source.id)
7. 176.014 364.137 ↑ 1.0 73,163 1

HashAggregate (cost=13,908.29..639,331.01 rows=75,171 width=773) (actual time=133.898..364.137 rows=73,163 loops=1)

  • Group Key: feed_1.id
8. 41.797 41.797 ↑ 1.0 73,163 1

Seq Scan on feed feed_1 (cost=0.00..13,720.36 rows=75,171 width=737) (actual time=0.009..41.797 rows=73,163 loops=1)

  • Filter: ((NOT is_pinned) AND (NOT is_deleted))
  • Rows Removed by Filter: 2071
9.          

SubPlan (forHashAggregate)

10. 146.326 146.326 ↑ 1.0 1 73,163

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=73,163)

  • Index Cond: (feed_id = feed_1.id)
11. 1.080 4.275 ↑ 1.0 2,026 1

Hash (cost=225.74..225.74 rows=2,026 width=308) (actual time=4.275..4.275 rows=2,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1002kB
12. 0.556 3.195 ↑ 1.0 2,026 1

Hash Left Join (cost=82.43..225.74 rows=2,026 width=308) (actual time=0.089..3.195 rows=2,026 loops=1)

  • Hash Cond: (feed_source.source_type_id = feed_source_type.id)
13. 1.381 2.620 ↑ 1.0 2,026 1

Hash Left Join (cost=65.90..203.82 rows=2,026 width=40) (actual time=0.059..2.620 rows=2,026 loops=1)

  • Hash Cond: (feed_source.source_class_id = feed_source_class.id)
14. 0.485 1.227 ↑ 1.0 2,026 1

Hash Left Join (cost=32.95..165.53 rows=2,026 width=229) (actual time=0.029..1.227 rows=2,026 loops=1)

  • Hash Cond: (feed_source.source_category_id = feed_source_category.id)
15. 0.735 0.735 ↑ 1.0 2,026 1

Seq Scan on feed_source (cost=0.00..127.26 rows=2,026 width=197) (actual time=0.011..0.735 rows=2,026 loops=1)

16. 0.004 0.007 ↑ 510.0 2 1

Hash (cost=20.20..20.20 rows=1,020 width=36) (actual time=0.007..0.007 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.003 0.003 ↑ 510.0 2 1

Seq Scan on feed_source_category (cost=0.00..20.20 rows=1,020 width=36) (actual time=0.003..0.003 rows=2 loops=1)

18. 0.009 0.012 ↑ 510.0 2 1

Hash (cost=20.20..20.20 rows=1,020 width=36) (actual time=0.012..0.012 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.003 0.003 ↑ 510.0 2 1

Seq Scan on feed_source_class (cost=0.00..20.20 rows=1,020 width=36) (actual time=0.003..0.003 rows=2 loops=1)

20. 0.003 0.019 ↑ 96.7 3 1

Hash (cost=12.90..12.90 rows=290 width=276) (actual time=0.019..0.019 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
21. 0.016 0.016 ↑ 96.7 3 1

Seq Scan on feed_source_type (cost=0.00..12.90 rows=290 width=276) (actual time=0.013..0.016 rows=3 loops=1)

22.          

SubPlan (forWindowAgg)

23. 0.040 0.240 ↑ 1.0 1 40

Aggregate (cost=1.34..1.35 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=40)

24. 0.040 0.200 ↓ 0.0 0 40

Sort (cost=1.31..1.31 rows=2 width=24) (actual time=0.005..0.005 rows=0 loops=40)

  • Sort Key: (count(ffs.*)) DESC
  • Sort Method: quicksort Memory: 25kB
25. 0.040 0.160 ↓ 0.0 0 40

HashAggregate (cost=1.28..1.30 rows=2 width=24) (actual time=0.004..0.004 rows=0 loops=40)

  • Group Key: ffs.type
26. 0.120 0.120 ↓ 0.0 0 40

Seq Scan on feed_feedback ffs (cost=0.00..1.26 rows=2 width=68) (actual time=0.003..0.003 rows=0 loops=40)

  • Filter: (feed_id = feed_1.id)
  • Rows Removed by Filter: 21
27. 556.072 556.072 ↑ 1,879.3 40 1

CTE Scan on t feed (cost=0.00..1,503.42 rows=75,171 width=371) (actual time=555.139..556.072 rows=40 loops=1)

Planning time : 0.841 ms
Execution time : 563.758 ms