explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tYAn : Optimization for: Optimization for: Optimization for: Optimization for: plan #3nEs; plan #1n0G; plan #WD4N; plan #IqoE

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.006 0.052 ↑ 2.0 10 1

Sort (cost=8,474.15..8,474.20 rows=20 width=76) (actual time=0.051..0.052 rows=10 loops=1)

  • Sort Key: ct.created_date DESC
  • Sort Method: quicksort Memory: 26kB
  • Planning time: 0.263 ms
  • Execution time: 0.093 ms
2.          

CTE ct

3. 0.008 0.041 ↑ 2.0 10 1

Recursive Union (cost=0.00..8,473.32 rows=20 width=77) (actual time=0.013..0.041 rows=10 loops=1)

4. 0.002 0.014 ↑ 1.0 10 1

Limit (cost=0.00..0.39 rows=10 width=77) (actual time=0.010..0.014 rows=10 loops=1)

5. 0.012 0.012 ↑ 100,000.0 10 1

Seq Scan on comment (cost=0.00..39,167.00 rows=1,000,000 width=77) (actual time=0.010..0.012 rows=10 loops=1)

  • Filter: ((parent_id IS NULL) AND (deleted_date IS NULL) AND (website_page_id = 1))
6. 0.008 0.019 ↓ 0.0 0 1

Nested Loop (cost=0.42..847.25 rows=1 width=77) (actual time=0.019..0.019 rows=0 loops=1)

7. 0.001 0.001 ↑ 10.0 10 1

WorkTable Scan on ct ct_1 (cost=0.00..2.00 rows=100 width=12) (actual time=0.000..0.001 rows=10 loops=1)

8. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_comment_parent_id on comment comment_1 (cost=0.42..8.44 rows=1 width=73) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (parent_id = ct_1.id)
9. 0.046 0.046 ↑ 2.0 10 1

CTE Scan on ct (cost=0.00..0.40 rows=20 width=76) (actual time=0.014..0.046 rows=10 loops=1)