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 12
CREATE TABLE
INSERT 0 12
CREATE TABLE
INSERT 0 12
id | date | asset | liability | security |
---|---|---|---|---|
1 | 2001-03-31 | 336896 | 311865 | 2 |
1 | 2001-06-30 | 333860 | 308524 | 1 |
1 | 2001-09-30 | 349343 | 308524 | 3 |
1 | 2002-12-31 | 353863 | 322659 | 4 |
2 | 2001-03-31 | 411421 | 391846 | 6 |
2 | 2001-06-30 | 451297 | 425156 | 5 |
2 | 2001-09-30 | 430178 | 41356 | 7 |
2 | 2002-12-31 | 481687 | 46589 | 8 |
3 | 2001-03-31 | 104196 | 102983 | 10 |
3 | 2001-06-30 | 106506 | 104532 | 9 |
3 | 2001-09-30 | 106383 | 104865 | 11 |
3 | 2002-12-31 | 107654 | 105867 | 12 |
SELECT 12