explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5REw : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #3nEs; plan #1n0G; plan #WD4N; plan #IqoE; plan #fB7S; plan #E6l

Settings

Optimization path:

Optimization(s) for this plan:

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

Sort (cost=8,476.52..8,476.57 rows=20 width=76) (actual time=0.039..0.040 rows=10 loops=1)

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

CTE ct

3. 0.005 0.030 ↑ 2.0 10 1

Recursive Union (cost=0.00..8,475.68 rows=20 width=77) (actual time=0.008..0.030 rows=10 loops=1)

4. 0.002 0.009 ↑ 1.0 10 1

Limit (cost=0.00..0.26 rows=10 width=77) (actual time=0.006..0.009 rows=10 loops=1)

5. 0.007 0.007 ↑ 200,000.0 10 1

Seq Scan on comment (cost=0.00..51,667.00 rows=2,000,000 width=77) (actual time=0.005..0.007 rows=10 loops=1)

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

Nested Loop (cost=0.43..847.50 rows=1 width=77) (actual time=0.016..0.016 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.43..8.45 rows=1 width=73) (actual time=0.001..0.001 rows=0 loops=10)

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

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