explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ARbr

Settings
# exclusive inclusive rows x rows loops node
1. 1.594 6,526.074 ↑ 87.0 343 1

GroupAggregate (cost=653,037.70..653,634.54 rows=29,842 width=40) (actual time=6,523.903..6,526.074 rows=343 loops=1)

  • Group Key: post_tag.post_id
2. 2.995 6,524.480 ↑ 2.4 12,578 1

Sort (cost=653,037.70..653,112.31 rows=29,842 width=16) (actual time=6,523.873..6,524.480 rows=12,578 loops=1)

  • Sort Key: post_tag.post_id
  • Sort Method: quicksort Memory: 974kB
3. 0.921 6,521.485 ↑ 2.4 12,578 1

Nested Loop (cost=499.55..650,819.69 rows=29,842 width=16) (actual time=6,517.054..6,521.485 rows=12,578 loops=1)

4. 0.033 6,517.124 ↓ 3.7 344 1

Subquery Scan on ANY_subquery (cost=499.11..648,004.58 rows=94 width=8) (actual time=6,517.008..6,517.124 rows=344 loops=1)

5. 10.250 6,517.091 ↓ 3.7 344 1

HashSetOp Intersect (cost=499.11..648,003.64 rows=94 width=12) (actual time=6,517.005..6,517.091 rows=344 loops=1)

6. 7.712 6,506.841 ↓ 1.5 137,248 1

Append (cost=499.11..647,773.48 rows=92,067 width=12) (actual time=2.227..6,506.841 rows=137,248 loops=1)

7. 0.097 2.477 ↓ 10.7 1,005 1

Subquery Scan on *SELECT* 1 (cost=499.11..500.76 rows=94 width=12) (actual time=2.226..2.477 rows=1,005 loops=1)

8. 0.090 2.380 ↓ 10.7 1,005 1

Unique (cost=499.11..499.58 rows=94 width=4) (actual time=2.221..2.380 rows=1,005 loops=1)

9.          

Initplan (for Unique)

10. 0.010 0.010 ↑ 1.0 1 1

Index Scan using post_pk on post post_1 (cost=0.43..8.45 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id = 1,960,722)
11. 0.016 0.016 ↑ 1.0 1 1

Index Scan using post_pk on post post_2 (cost=0.43..8.45 rows=1 width=3) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: (id = 1,960,722)
12. 0.181 2.264 ↓ 10.7 1,005 1

Sort (cost=482.22..482.46 rows=94 width=4) (actual time=2.220..2.264 rows=1,005 loops=1)

  • Sort Key: post.id
  • Sort Method: quicksort Memory: 72kB
13. 2.083 2.083 ↓ 10.7 1,005 1

Index Scan using post_count_1_index on post (cost=0.56..479.14 rows=94 width=4) (actual time=0.086..2.083 rows=1,005 loops=1)

  • Index Cond: (((lang)::text = ($1)::text) AND (created_on > (now() - '48:00:00'::interval)) AND (category = $0))
14. 10.215 6,496.652 ↓ 1.5 136,243 1

Subquery Scan on *SELECT* 2 (cost=644,972.92..646,812.38 rows=91,973 width=12) (actual time=6,458.949..6,496.652 rows=136,243 loops=1)

15. 233.804 6,486.437 ↓ 1.5 136,243 1

HashAggregate (cost=644,972.92..645,892.65 rows=91,973 width=8) (actual time=6,458.946..6,486.437 rows=136,243 loops=1)

  • Group Key: post_tag_1.post_id
16. 1,483.578 6,252.633 ↑ 25.6 171,609 1

Hash Join (cost=20.95..633,974.40 rows=4,399,410 width=8) (actual time=0.075..6,252.633 rows=171,609 loops=1)

  • Hash Cond: (post_tag_1.tag_id = post_tag_2.tag_id)
17. 4,769.008 4,769.008 ↑ 1.0 17,229,139 1

Seq Scan on post_tag post_tag_1 (cost=0.00..588,135.69 rows=17,388,959 width=16) (actual time=0.017..4,769.008 rows=17,229,139 loops=1)

  • Filter: recom
  • Rows Removed by Filter: 11,862,673
18. 0.009 0.047 ↑ 8.1 39 1

Hash (cost=16.99..16.99 rows=317 width=8) (actual time=0.047..0.047 rows=39 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
19. 0.038 0.038 ↑ 8.1 39 1

Index Scan using post_tag_post_id_index on post_tag post_tag_2 (cost=0.44..16.99 rows=317 width=8) (actual time=0.032..0.038 rows=39 loops=1)

  • Index Cond: (post_id = 1,960,722)
20. 3.440 3.440 ↑ 8.6 37 344

Index Scan using post_tag_post_id_index on post_tag (cost=0.44..26.78 rows=317 width=16) (actual time=0.003..0.010 rows=37 loops=344)

  • Index Cond: (post_id = "ANY_subquery".post_id)
  • Filter: (post_id <> 1960722)
  • Rows Removed by Filter: 0
Planning time : 2.612 ms
Execution time : 6,529.650 ms