explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Onh3

Settings
# exclusive inclusive rows x rows loops node
1. 0.532 539.100 ↓ 1.0 753 1

Sort (cost=8,245.75..8,247.62 rows=750 width=99) (actual time=539.015..539.100 rows=753 loops=1)

  • Sort Key: (count(post.id)) DESC
  • Sort Method: quicksort Memory: 161kB
2. 233.184 538.568 ↓ 1.0 753 1

HashAggregate (cost=8,202.43..8,209.93 rows=750 width=99) (actual time=538.373..538.568 rows=753 loops=1)

  • Group Key: card.id
3. 216.799 305.384 ↓ 10.3 890,723 1

Hash Join (cost=6,006.98..7,770.48 rows=86,390 width=95) (actual time=66.538..305.384 rows=890,723 loops=1)

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

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

  • Hash Cond: (post_to_tag_link_1.post_id = post.id)
5. 5.184 5.184 ↑ 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.015..5.184 rows=32,633 loops=1)

6. 7.379 63.564 ↓ 2.0 24,491 1

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

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

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

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

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

9. 6.727 35.134 ↓ 1.0 24,491 1

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

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

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

11. 19.123 24.019 ↓ 1.0 24,491 1

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

  • Group Key: post_to_tag_link.post_id
12. 4.896 4.896 ↑ 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.016..4.896 rows=32,633 loops=1)

13. 0.561 2.902 ↓ 1.1 1,318 1

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

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

Hash Join (cost=39.91..90.39 rows=1,186 width=99) (actual time=0.735..2.341 rows=1,318 loops=1)

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

Hash Join (cost=29.88..64.04 rows=1,186 width=95) (actual time=0.574..1.494 rows=1,318 loops=1)

  • Hash Cond: (card_to_tag_link_1.card_id = card.id)
16. 0.233 0.233 ↓ 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.015..0.233 rows=1,318 loops=1)

17. 0.287 0.543 ↓ 1.0 757 1

Hash (cost=20.50..20.50 rows=750 width=91) (actual time=0.543..0.543 rows=757 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 104kB
18. 0.256 0.256 ↓ 1.0 757 1

Seq Scan on card (cost=0.00..20.50 rows=750 width=91) (actual time=0.010..0.256 rows=757 loops=1)

19. 0.077 0.153 ↑ 1.0 224 1

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

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

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