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
date | price | seqnum | ?column? | ?column? |
---|---|---|---|---|
2020-01-01 | 1 | 0 | 1.00000000000000000000 | 1.00000000000000000000 |
2020-01-02 | 2 | 1 | 1.5000000000000000 | 1.6666666666666667 |
2020-01-03 | 3 | 2 | 2.2500000000000000 | 2.4285714285714286 |
2020-01-04 | 4 | 3 | 3.1250000000000000 | 3.2666666666666667 |
SELECT 4
seqnum | date | price | exp_avg |
---|---|---|---|
1 | 2020-01-01 | 1 | 1.0 |
2 | 2020-01-02 | 2 | 1.50 |
3 | 2020-01-03 | 3 | 2.250 |
4 | 2020-01-04 | 4 | 3.1250 |
SELECT 4