explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DumW

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1,533.151 ↑ 1.0 2 1

Limit (cost=271,716.81..271,716.81 rows=2 width=320) (actual time=1,533.151..1,533.151 rows=2 loops=1)

2. 2.658 1,533.150 ↑ 1,074.0 2 1

Sort (cost=271,716.81..271,722.18 rows=2,148 width=320) (actual time=1,533.150..1,533.150 rows=2 loops=1)

  • Sort Key: bp1.date_last_comment DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 40.606 1,530.492 ↓ 2.2 4,748 1

GroupAggregate (cost=271,630.89..271,695.33 rows=2,148 width=320) (actual time=1,486.828..1,530.492 rows=4,748 loops=1)

  • Group Key: bp1.id_post
4. 8.801 1,489.886 ↓ 2.1 8,835 1

Sort (cost=271,630.89..271,641.63 rows=4,296 width=320) (actual time=1,486.774..1,489.886 rows=8,835 loops=1)

  • Sort Key: bp1.id_post
  • Sort Method: quicksort Memory: 6918kB
5. 4.598 1,481.085 ↓ 2.1 8,835 1

Nested Loop Left Join (cost=126.19..271,371.65 rows=4,296 width=320) (actual time=0.389..1,481.085 rows=8,835 loops=1)

6. 33.095 33.095 ↓ 2.2 4,748 1

Index Scan using fki_blog_posts_blogs on posts bp1 (cost=0.43..1,155.97 rows=2,148 width=69) (actual time=0.021..33.095 rows=4,748 loops=1)

  • Index Cond: (id_blog = ANY ('{1,22,16}'::integer[]))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 1914
7. 14.244 1,443.392 ↑ 1.0 2 4,748

Subquery Scan on c1 (cost=125.75..125.78 rows=2 width=251) (actual time=0.303..0.304 rows=2 loops=4,748)

8. 0.000 1,429.148 ↑ 1.0 2 4,748

Limit (cost=125.75..125.76 rows=2 width=227) (actual time=0.301..0.301 rows=2 loops=4,748)

9. 71.220 1,429.148 ↑ 19.0 2 4,748

Sort (cost=125.75..125.85 rows=38 width=227) (actual time=0.300..0.301 rows=2 loops=4,748)

  • Sort Key: bc1.thread_date DESC
  • Sort Method: top-N heapsort Memory: 25kB
10. 147.188 1,357.928 ↑ 1.1 35 4,748

HashAggregate (cost=124.99..125.37 rows=38 width=227) (actual time=0.279..0.286 rows=35 loops=4,748)

  • Group Key: bc1.id_comment, bcv1.is_up
11. 60.328 1,210.740 ↑ 1.1 35 4,748

Nested Loop Left Join (cost=0.99..124.80 rows=38 width=227) (actual time=0.019..0.255 rows=35 loops=4,748)

12. 645.728 645.728 ↑ 1.1 35 4,748

Index Scan using idx_comments_posts_parents on comments bc1 (cost=0.56..31.32 rows=38 width=226) (actual time=0.014..0.136 rows=35 loops=4,748)

  • Index Cond: ((id_post = bp1.id_post) AND (id_parent = 0))
13. 504.684 504.684 ↓ 0.0 0 168,228

Index Scan using pk_blog_comment_votes on comment_votes bcv1 (cost=0.43..2.45 rows=1 width=9) (actual time=0.003..0.003 rows=0 loops=168,228)

  • Index Cond: ((id_user = 288) AND (bc1.id_comment = id_comment))
Planning time : 3.036 ms
Execution time : 1,533.308 ms