explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o9HG

Settings
# exclusive inclusive rows x rows loops node
1. 0.542 480.099 ↑ 1.0 753 1

Sort (cost=8,246.36..8,248.25 rows=757 width=99) (actual time=480.018..480.099 rows=753 loops=1)

  • Sort Key: (count(post.id)) DESC
  • Sort Method: quicksort Memory: 161kB
2. 208.432 479.557 ↑ 1.0 753 1

HashAggregate (cost=8,202.59..8,210.16 rows=757 width=99) (actual time=479.304..479.557 rows=753 loops=1)

  • Group Key: card.id
3. 196.430 271.125 ↓ 10.3 890,723 1

Hash Join (cost=6,007.14..7,770.64 rows=86,390 width=95) (actual time=54.163..271.125 rows=890,723 loops=1)

  • Hash Cond: (post_to_tag_link_1.tag_id = tag.id)
4. 16.104 72.524 ↓ 2.0 32,633 1

Hash Join (cost=5,901.77..6,658.63 rows=16,316 width=8) (actual time=51.985..72.524 rows=32,633 loops=1)

  • Hash Cond: (post_to_tag_link_1.post_id = post.id)
5. 4.503 4.503 ↑ 1.0 32,633 1

Seq Scan on post_to_tag_link post_to_tag_link_1 (cost=0.00..471.33 rows=32,633 width=8) (actual time=0.012..4.503 rows=32,633 loops=1)

6. 6.562 51.917 ↓ 2.0 24,491 1

Hash (cost=5,748.69..5,748.69 rows=12,246 width=8) (actual time=51.917..51.917 rows=24,491 loops=1)

  • Buckets: 32768 (originally 16384) Batches: 1 (originally 1) Memory Usage: 1213kB
7. 11.567 45.355 ↓ 2.0 24,491 1

Hash Join (cost=1,336.75..5,748.69 rows=12,246 width=8) (actual time=27.773..45.355 rows=24,491 loops=1)

  • Hash Cond: (post.id = a.post_id)
8. 6.217 6.217 ↑ 1.0 24,492 1

Seq Scan on post (cost=0.00..4,078.92 rows=24,492 width=4) (actual time=0.007..6.217 rows=24,492 loops=1)

9. 5.494 27.571 ↓ 1.0 24,491 1

Hash (cost=1,035.27..1,035.27 rows=24,118 width=4) (actual time=27.571..27.571 rows=24,491 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1118kB
10. 3.434 22.077 ↓ 1.0 24,491 1

Subquery Scan on a (cost=552.91..1,035.27 rows=24,118 width=4) (actual time=13.694..22.077 rows=24,491 loops=1)

11. 14.872 18.643 ↓ 1.0 24,491 1

HashAggregate (cost=552.91..794.09 rows=24,118 width=36) (actual time=13.694..18.643 rows=24,491 loops=1)

  • Group Key: post_to_tag_link.post_id
12. 3.771 3.771 ↑ 1.0 32,633 1

Seq Scan on post_to_tag_link (cost=0.00..471.33 rows=32,633 width=4) (actual time=0.012..3.771 rows=32,633 loops=1)

13. 0.435 2.171 ↓ 1.1 1,318 1

Hash (cost=90.55..90.55 rows=1,186 width=99) (actual time=2.171..2.171 rows=1,318 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 196kB
14. 0.465 1.736 ↓ 1.1 1,318 1

Hash Join (cost=40.07..90.55 rows=1,186 width=99) (actual time=0.595..1.736 rows=1,318 loops=1)

  • Hash Cond: (card_to_tag_link_1.tag_id = tag.id)
15. 0.524 1.151 ↓ 1.1 1,318 1

Hash Join (cost=30.03..64.20 rows=1,186 width=95) (actual time=0.471..1.151 rows=1,318 loops=1)

  • Hash Cond: (card_to_tag_link_1.card_id = card.id)
16. 0.185 0.185 ↓ 1.1 1,318 1

Seq Scan on card_to_tag_link card_to_tag_link_1 (cost=0.00..17.86 rows=1,186 width=8) (actual time=0.020..0.185 rows=1,318 loops=1)

17. 0.271 0.442 ↑ 1.0 757 1

Hash (cost=20.57..20.57 rows=757 width=91) (actual time=0.442..0.442 rows=757 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 104kB
18. 0.171 0.171 ↑ 1.0 757 1

Seq Scan on card (cost=0.00..20.57 rows=757 width=91) (actual time=0.008..0.171 rows=757 loops=1)

19. 0.056 0.120 ↑ 1.0 224 1

Hash (cost=7.24..7.24 rows=224 width=4) (actual time=0.120..0.120 rows=224 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
20. 0.064 0.064 ↑ 1.0 224 1

Seq Scan on tag (cost=0.00..7.24 rows=224 width=4) (actual time=0.011..0.064 rows=224 loops=1)