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?.
10 rows affected
id | time_stamp | value |
---|---|---|
1 | 2018-06-08 10:03:00 | 1 |
2 | 2018-06-08 10:06:00 | 2 |
3 | 2018-06-08 10:09:00 | 3 |
4 | 2018-06-08 10:12:00 | 4 |
5 | 2018-06-08 10:15:00 | 5 |
6 | 2018-06-08 10:18:00 | 6 |
7 | 2018-06-08 10:21:00 | 7 |
8 | 2018-06-08 10:24:00 | 8 |
9 | 2018-06-08 10:27:00 | 9 |
10 | 2018-06-08 10:30:00 | 10 |
first_value | last_value | year | month | day | hour | quarter |
---|---|---|---|---|---|---|
1 | 4 | 2018 | 6 | 8 | 10 | 0 |
5 | 9 | 2018 | 6 | 8 | 10 | 1 |
10 | 10 | 2018 | 6 | 8 | 10 | 2 |