explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BPyx

Settings
# exclusive inclusive rows x rows loops node
1. 0.073 0.149 ↑ 1,000.0 1 1

CTE Scan on "somePeriods" od (cost=10.25..17,494,052.75 rows=1,000 width=16) (actual time=0.149..0.149 rows=1 loops=1)

2.          

CTE somePeriods

3. 0.069 0.069 ↑ 1,000.0 1 1

Function Scan on my_test_function f (cost=0.25..10.25 rows=1,000 width=12) (actual time=0.068..0.069 rows=1 loops=1)

4.          

SubPlan (for CTE Scan)

5. 0.003 0.076 ↑ 1.0 1 1

Aggregate (cost=17,494.01..17,494.02 rows=1 width=4) (actual time=0.076..0.076 rows=1 loops=1)

6.          

CTE prep

7. 0.002 0.008 ↑ 55,565.0 1 1

Recursive Union (cost=0.00..16,243.80 rows=55,565 width=8) (actual time=0.003..0.008 rows=1 loops=1)

8. 0.002 0.002 ↑ 5.0 1 1

CTE Scan on "somePeriods" (cost=0.00..22.50 rows=5 width=8) (actual time=0.002..0.002 rows=1 loops=1)

  • Filter: (id = od.id)
9. 0.003 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.00..1,511.00 rows=5,556 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: (("somePeriods_1"."startDate" <= (prep."endDateParam" + '1 day'::interval)) AND ((prep."endDateParam" + '1 day'::interval) <= "somePeriods_1"."endDate"))
  • Rows Removed by Join Filter: 1
10. 0.001 0.001 ↑ 50.0 1 1

WorkTable Scan on prep (cost=0.00..1.00 rows=50 width=4) (actual time=0.000..0.001 rows=1 loops=1)

11. 0.000 0.000 ↑ 1,000.0 1 1

CTE Scan on "somePeriods" "somePeriods_1" (cost=0.00..20.00 rows=1,000 width=8) (actual time=0.000..0.000 rows=1 loops=1)

12. 0.073 0.073 ↑ 55,565.0 1 1

CTE Scan on prep prep_1 (cost=0.00..1,111.30 rows=55,565 width=4) (actual time=0.068..0.073 rows=1 loops=1)

Planning time : 0.299 ms
Execution time : 1.535 ms