explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X2vi

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.132 ↑ 1,475,799.0 2 1

Sort (cost=1,980,181.98..1,987,560.97 rows=2,951,598 width=232) (actual time=0.132..0.132 rows=2 loops=1)

  • Sort Key: links.date_added DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.002 0.128 ↑ 1,475,799.0 2 1

Unique (cost=1,385,351.70..1,473,899.64 rows=2,951,598 width=232) (actual time=0.126..0.128 rows=2 loops=1)

3. 0.016 0.126 ↑ 1,475,799.0 2 1

Sort (cost=1,385,351.70..1,392,730.70 rows=2,951,598 width=232) (actual time=0.126..0.126 rows=2 loops=1)

  • Sort Key: links.id, links.userid, links.parent, links.type, links.host, links.url, links.date_added, links.label, links.doc_linked, links.task_linked, links.date_added
  • Sort Method: quicksort Memory: 25kB
4. 0.001 0.110 ↑ 1,475,799.0 2 1

Append (cost=1.14..879,069.37 rows=2,951,598 width=232) (actual time=0.046..0.110 rows=2 loops=1)

5. 0.002 0.060 ↑ 476,411.0 1 1

Nested Loop (cost=1.14..437,868.85 rows=476,411 width=185) (actual time=0.045..0.060 rows=1 loops=1)

6. 0.028 0.028 ↑ 66.5 2 1

Index Scan using comment_parent_idx on comments (cost=0.56..157.73 rows=133 width=8) (actual time=0.025..0.028 rows=2 loops=1)

  • Index Cond: (parent = '6mb5kv'::text)
  • Filter: (type = 1)
7. 0.030 0.030 ↓ 0.0 0 2

Index Scan using links_parent_type_idx on links (cost=0.57..3,255.24 rows=3,582 width=177) (actual time=0.014..0.015 rows=0 loops=2)

  • Index Cond: ((parent = (comments.id)::text) AND (type = 0))
8. 0.002 0.049 ↑ 2,475,187.0 1 1

Nested Loop (cost=1.71..396,926.55 rows=2,475,187 width=185) (actual time=0.036..0.049 rows=1 loops=1)

9. 0.002 0.041 ↑ 691.0 1 1

Nested Loop (cost=1.14..22,986.46 rows=691 width=8) (actual time=0.029..0.041 rows=1 loops=1)

10. 0.015 0.015 ↑ 72.5 2 1

Index Scan using task_id_idx2 on comments comments_1 (cost=0.56..161.04 rows=145 width=8) (actual time=0.013..0.015 rows=2 loops=1)

  • Index Cond: (task_id = '6mb5kv'::text)
11. 0.024 0.024 ↓ 0.0 0 2

Index Scan using comment_parent_idx on comments threaded_comments (cost=0.57..157.37 rows=5 width=15) (actual time=0.012..0.012 rows=0 loops=2)

  • Index Cond: (parent = (comments_1.id)::text)
  • Filter: (type = 2)
12. 0.006 0.006 ↑ 3,582.0 1 1

Index Scan using links_parent_type_idx on links links_1 (cost=0.57..505.34 rows=3,582 width=177) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((parent = (threaded_comments.id)::text) AND (type = 0))
Planning time : 0.397 ms
Execution time : 0.235 ms