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 7
user | status | days_in_status | min | max |
---|---|---|---|---|
1 | open | 3 | 2017-12-01 | 2017-12-03 |
1 | closed | 2 | 2017-12-04 | 2017-12-05 |
1 | open | 2 | 2017-12-06 | 2017-12-07 |
SELECT 3