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?.
7 rows affected
player | dt | is_winner | expected |
---|---|---|---|
A | 2019-01-01 | t | 0 |
A | 2019-01-03 | t | 1 |
A | 2019-01-04 | t | 2 |
A | 2019-01-09 | f | 0 |
A | 2019-01-10 | f | -1 |
A | 2019-01-11 | f | -2 |
A | 2019-01-15 | t | 0 |
player | dt | is_winner | prev_is_winner | expected | is_new_group | streak_group | expected_unsigned | actual |
---|---|---|---|---|---|---|---|---|
A | 2019-01-01 | t | null | 0 | 1 | 1 | 0 | 0 |
A | 2019-01-03 | t | t | 1 | 0 | 1 | 1 | 1 |
A | 2019-01-04 | t | t | 2 | 0 | 1 | 2 | 2 |
A | 2019-01-09 | f | t | 0 | 1 | 2 | 0 | 0 |
A | 2019-01-10 | f | f | -1 | 0 | 2 | 1 | -1 |
A | 2019-01-11 | f | f | -2 | 0 | 2 | 2 | -2 |
A | 2019-01-15 | t | f | 0 | 1 | 3 | 0 | 0 |