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 4
hour | max |
---|---|
2025-02-17 09:00:00 | 1 |
2025-02-17 10:00:00 | 1 |
2025-02-17 11:00:00 | 1 |
2025-02-17 12:00:00 | 1 |
2025-02-17 13:00:00 | 1 |
2025-02-17 14:00:00 | 1 |
2025-02-17 15:00:00 | 1 |
2025-02-17 16:00:00 | 1 |
2025-02-17 17:00:00 | 1 |
2025-02-17 18:00:00 | 2 |
2025-02-17 19:00:00 | 2 |
2025-02-17 20:00:00 | 1 |
SELECT 12