explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zHZs

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 434.737 ↑ 1.0 15 1

Limit (cost=7,258.09..7,258.12 rows=15 width=99) (actual time=434.727..434.737 rows=15 loops=1)

2. 0.294 434.726 ↑ 18.0 30 1

Sort (cost=7,258.05..7,259.40 rows=541 width=99) (actual time=434.723..434.726 rows=30 loops=1)

  • Sort Key: (count(post.id)) DESC
  • Sort Method: top-N heapsort Memory: 29kB
3. 185.484 434.432 ↓ 1.0 562 1

HashAggregate (cost=7,236.66..7,242.07 rows=541 width=99) (actual time=434.282..434.432 rows=562 loops=1)

  • Group Key: card.id
4. 167.112 248.948 ↓ 5.6 592,429 1

Hash Join (cost=4,598.15..6,703.08 rows=106,716 width=95) (actual time=59.417..248.948 rows=592,429 loops=1)

  • Hash Cond: (post_to_tag_link_1.tag_id = tag.id)
5. 16.421 77.717 ↑ 1.2 20,927 1

Hash Join (cost=4,500.76..5,348.23 rows=25,376 width=8) (actual time=55.273..77.717 rows=20,927 loops=1)

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

7. 9.216 54.941 ↓ 1.0 19,103 1

Hash (cost=4,262.66..4,262.66 rows=19,048 width=4) (actual time=54.941..54.941 rows=19,103 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 928kB
8. 45.725 45.725 ↓ 1.0 19,103 1

Seq Scan on post (cost=0.00..4,262.66 rows=19,048 width=4) (actual time=0.033..45.725 rows=19,103 loops=1)

  • Filter: (date > (now() - '60 days'::interval))
  • Rows Removed by Filter: 5392
9. 1.017 4.119 ↓ 1.2 1,123 1

Hash (cost=85.61..85.61 rows=942 width=99) (actual time=4.119..4.119 rows=1,123 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 174kB
10. 0.763 3.102 ↓ 1.2 1,123 1

Hash Join (cost=39.26..85.61 rows=942 width=99) (actual time=1.189..3.102 rows=1,123 loops=1)

  • Hash Cond: (card_to_tag_link_1.tag_id = tag.id)
11. 0.893 2.130 ↓ 1.2 1,123 1

Hash Join (cost=29.22..62.62 rows=942 width=95) (actual time=0.954..2.130 rows=1,123 loops=1)

  • Hash Cond: (card_to_tag_link_1.card_id = card.id)
12. 0.335 0.335 ↑ 1.0 1,318 1

Seq Scan on card_to_tag_link card_to_tag_link_1 (cost=0.00..19.18 rows=1,318 width=8) (actual time=0.018..0.335 rows=1,318 loops=1)

13. 0.410 0.902 ↓ 1.0 562 1

Hash (cost=22.46..22.46 rows=541 width=91) (actual time=0.902..0.902 rows=562 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 83kB
14. 0.492 0.492 ↓ 1.0 562 1

Seq Scan on card (cost=0.00..22.46 rows=541 width=91) (actual time=0.027..0.492 rows=562 loops=1)

  • Filter: ((type)::text = 'area-region'::text)
  • Rows Removed by Filter: 195
15. 0.096 0.209 ↑ 1.0 224 1

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

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

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