explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OI1C

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

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

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

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

  • Group Key: card.id
3. 210.426 303.441 ↓ 10.3 890,723 1

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

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

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

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

6. 8.379 70.411 ↓ 2.0 24,491 1

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

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

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

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

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

9. 7.631 39.780 ↓ 1.0 24,491 1

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

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

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

11. 21.720 27.253 ↓ 1.0 24,491 1

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

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

13. 0.599 3.132 ↓ 1.1 1,318 1

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

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

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

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

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

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

17. 0.374 0.638 ↓ 1.0 757 1

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

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

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

19. 0.073 0.148 ↑ 1.0 224 1

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

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

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