explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.008 0.063 ↑ 2.0 10 1

Sort (cost=8,477.13..8,477.18 rows=20 width=76) (actual time=0.062..0.063 rows=10 loops=1)

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

CTE ct

3. 0.009 0.050 ↑ 2.0 10 1

Recursive Union (cost=0.43..8,476.30 rows=20 width=77) (actual time=0.014..0.050 rows=10 loops=1)

4. 0.003 0.018 ↑ 1.0 10 1

Limit (cost=0.43..0.88 rows=10 width=77) (actual time=0.011..0.018 rows=10 loops=1)

5. 0.015 0.015 ↑ 200,000.4 10 1

Index Scan using index_comment_created_date_desc on comment (cost=0.43..89,626.50 rows=2,000,004 width=77) (actual time=0.010..0.015 rows=10 loops=1)

  • Filter: ((parent_id IS NULL) AND (deleted_date IS NULL) AND (website_page_id = 1))
  • Rows Removed by Filter: 2
6. 0.002 0.023 ↓ 0.0 0 1

Nested Loop (cost=0.43..847.50 rows=1 width=77) (actual time=0.023..0.023 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.001..0.001 rows=10 loops=1)

8. 0.020 0.020 ↓ 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.002..0.002 rows=0 loops=10)

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

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