By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TABLE
INSERT 0 14
CREATE FUNCTION
CREATE FUNCTION
t_id | t_start | t_end | f_worktime |
---|---|---|---|
1 | 2009-12-03 14:00:00 | 2009-12-04 09:00:00 | 02:00:00 |
2 | 2009-12-03 15:00:00 | 2009-12-07 08:00:00 | 07:00:00 |
3 | 2013-06-24 07:00:00 | 2013-06-24 11:00:00 | 03:00:00 |
4 | 2013-06-23 13:00:00 | 2013-06-25 11:00:00 | 10:00:00 |
5 | 2013-06-23 13:00:00 | 2013-06-25 11:00:00 | 10:00:00 |
6 | 2009-12-03 14:22:00 | 2009-12-04 09:11:00 | 01:49:00 |
7 | 2009-12-03 14:59:00 | 2009-12-03 15:01:00 | 00:01:00 |
8 | 2009-12-03 14:59:00 | 2009-12-04 15:01:00 | 07:01:00 |
9 | 2009-12-03 08:59:00 | 2009-12-03 09:01:00 | 00:02:00 |
10 | 2009-12-03 08:59:00 | 2009-12-04 09:01:00 | 07:02:00 |
11 | 2009-12-03 08:55:00 | 2009-12-03 09:03:00 | 00:08:00 |
12 | 2009-12-03 08:58:00 | 2009-12-03 09:01:00 | 00:03:00 |
13 | 2009-12-03 08:59:00 | 2009-12-03 09:02:00 | 00:03:00 |
14 | 2009-12-03 07:59:00 | 2009-12-03 08:02:00 | 00:02:00 |
SELECT 14