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 6
range | open | close | datetime |
---|---|---|---|
P1 | 10.2 | 11.2 | 2023-03-17 00:00:00 |
P2 | 10.2 | 11.2 | 2023-03-17 00:00:00 |
P1 | 11.4 | 12.3 | 2023-03-16 00:00:00 |
P2 | 11.4 | 12.3 | 2023-03-16 00:00:00 |
P1 | 11.7 | 12.2 | 2023-03-15 00:00:00 |
P2 | 11.7 | 12.2 | 2023-03-15 00:00:00 |
P1 | 12.1 | 11.1 | 2023-03-14 00:00:00 |
P1 | 11.0 | 10.1 | 2023-03-13 00:00:00 |
P1 | 10.2 | 11.5 | 2023-03-12 00:00:00 |
SELECT 9