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?.
8 rows affected
id | bar | lag |
---|---|---|
1 | 7 | null |
2 | 8 | 7 |
3 | 30 | 8 |
4 | 25 | 30 |
5 | 24 | 25 |
6 | 24 | 24 |
7 | 35 | 24 |
8 | 40 | 35 |
id | bar | previous |
---|---|---|
1 | 7 | Nothing to compare |
2 | 8 | Lower |
3 | 30 | Lower |
4 | 25 | Higher |
5 | 24 | Higher |
6 | 24 | Equal |
7 | 35 | Lower |
8 | 40 | Lower |