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?.
SELECT 4
year | changes | interest | running_interest | prev_running_interest | val |
---|---|---|---|---|---|
2020 | 10000 | 2.5 | 1.08240615000000000001 | 1.05600600000000000001 | 10249.99999999999999999763 |
2021 | 0 | 2.0 | 1.05600600000000000001 | 1.03530000000000000001 | 10454.99999999999999999561 |
2022 | 5000 | 2.0 | 1.03530000000000000001 | 1.01500000000000000000 | 15764.10000000000000014778 |
2023 | 0 | 1.5 | 1.01500000000000000000 | null | 16000.56150000000000015000 |
SELECT 4