add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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 9
dates sales
2019-01-01 1
2019-01-02 3
2019-01-03 5
2019-01-04 2
2019-01-05 7
2019-01-06 8
2019-01-08 10
2019-01-09 1
2019-01-10 8
SELECT 9
dates sales
2019-01-01 1
2019-01-02 3
2019-01-03 5
2019-01-04 2
2019-01-05 7
2019-01-06 8
2019-01-07 null
2019-01-08 10
2019-01-09 1
2019-01-10 8
2019-01-11 null
SELECT 11
dates sales sum
2019-01-01 1 1
2019-01-02 3 4
2019-01-03 5 9
2019-01-04 2 11
2019-01-05 7 18
2019-01-06 8 26
2019-01-07 0 26
2019-01-08 10 35
2019-01-09 1 33
2019-01-10 8 36
2019-01-11 0 34
SELECT 11
dates sales sum
2019-01-01 1 1
2019-01-02 3 4
2019-01-03 5 9
2019-01-04 2 11
2019-01-05 7 18
2019-01-06 8 26
2019-01-07 0 26
2019-01-08 10 35
2019-01-09 1 33
2019-01-10 8 36
SELECT 10