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
CREATE FUNCTION
CREATE TRIGGER
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
cdate | simple_mov_avg |
---|---|
2019-01-10 | 108.0000000000000000 |
2019-01-11 | 108.5000000000000000 |
2019-01-13 | 109.0000000000000000 |
2019-01-14 | 109.7500000000000000 |
2019-01-16 | 110.4000000000000000 |
2019-01-17 | 111.1666666666666667 |
2019-01-18 | 112.0000000000000000 |
2019-01-20 | 113.0000000000000000 |
SELECT 8
cdate | open | high | low | close | sma8 |
---|---|---|---|---|---|
2019-01-10 | 101.00 | 110.00 | 95.00 | 108.00 | 108.00 |
2019-01-11 | 101.00 | 110.00 | 95.00 | 109.00 | 108.50 |
2019-01-13 | 101.00 | 110.00 | 95.00 | 110.00 | 109.00 |
2019-01-14 | 101.00 | 110.00 | 95.00 | 112.00 | 109.75 |
2019-01-16 | 101.00 | 110.00 | 95.00 | 113.00 | 110.40 |
2019-01-17 | 101.00 | 110.00 | 95.00 | 115.00 | 111.17 |
2019-01-18 | 101.00 | 110.00 | 95.00 | 117.00 | 112.00 |
2019-01-20 | 101.00 | 110.00 | 95.00 | 120.00 | 113.00 |
SELECT 8