explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T4OX

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 6.112 ↑ 1.0 1 1

Result (cost=63.19..63.20 rows=1 width=8) (actual time=6.111..6.112 rows=1 loops=1)

2.          

Initplan (forResult)

3. 0.314 5.638 ↑ 1.0 1 1

Aggregate (cost=25.01..25.03 rows=1 width=4) (actual time=5.637..5.638 rows=1 loops=1)

4. 5.324 5.324 ↓ 1,202.0 2,404 1

Function Scan on generate_series h (cost=0.00..25.00 rows=2 width=0) (actual time=1.532..5.324 rows=2,404 loops=1)

  • Filter: ((date_part('isodow'::text, h) < '10'::double precision) AND ((h)::time without time zone >= '07:00:00'::time without time zone) AND ((h)::time without time zone <= '17:00:00'::time without time zone))
  • Rows Removed by Filter: 3356
5. 0.002 0.026 ↑ 1.0 1 1

Aggregate (cost=15.03..15.05 rows=1 width=8) (actual time=0.026..0.026 rows=1 loops=1)

6. 0.024 0.024 ↓ 0.0 0 1

Function Scan on generate_series weekend (cost=0.01..15.01 rows=10 width=8) (actual time=0.024..0.024 rows=0 loops=1)

  • Filter: (date_part('ISODOW'::text, weekend) = ANY ('{6,7}'::double precision[]))
  • Rows Removed by Filter: 5
7. 0.003 0.440 ↑ 1.0 1 1

Aggregate (cost=23.10..23.12 rows=1 width=8) (actual time=0.440..0.440 rows=1 loops=1)

8. 0.026 0.437 ↑ 12.0 1 1

Merge Semi Join (cost=22.11..23.07 rows=12 width=8) (actual time=0.434..0.437 rows=1 loops=1)

  • Merge Cond: (holiday.holiday = (((publicholidays.holidays)::timestamp without time zone)::date))
9. 0.012 0.035 ↑ 5.0 5 1

Sort (cost=19.34..19.40 rows=25 width=8) (actual time=0.035..0.035 rows=5 loops=1)

  • Sort Key: holiday.holiday
  • Sort Method: quicksort Memory: 25kB
10. 0.023 0.023 ↑ 5.0 5 1

Function Scan on generate_series holiday (cost=0.01..18.76 rows=25 width=8) (actual time=0.018..0.023 rows=5 loops=1)

  • Filter: (date_part('ISODOW'::text, holiday) = ANY ('{1,2,3,4,5}'::double precision[]))
11. 0.056 0.376 ↓ 1.2 57 1

Sort (cost=2.78..2.89 rows=47 width=11) (actual time=0.372..0.376 rows=57 loops=1)

  • Sort Key: (((publicholidays.holidays)::timestamp without time zone)::date)
  • Sort Method: quicksort Memory: 29kB
12. 0.320 0.320 ↓ 2.0 94 1

Seq Scan on publicholidays (cost=0.00..1.47 rows=47 width=11) (actual time=0.053..0.320 rows=94 loops=1)

Planning time : 0.519 ms