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?.
6 rows affected
6 rows affected
ctr_id | mth | cumulative_pmt_amt | cumulative_amt | balance |
---|---|---|---|---|
1 | 2019-01-01 | 145.0 | 0 | -145.0 |
1 | 2019-02-01 | 290.0 | 290.0 | 0.0 |
1 | 2019-03-01 | 435.0 | 435.0 | 0.0 |
1 | 2019-04-01 | 580.0 | 580.0 | 0.0 |
1 | 2019-05-01 | 725.0 | 580.0 | -145.0 |
1 | 2019-06-01 | 870.0 | 725.0 | -145.0 |
4 rows affected
ctr_id | mth | cumulative_pmt_amt | cumulative_amt | balance |
---|---|---|---|---|
1 | 2019-01-01 | 145.0 | 145.0 | 0.0 |
1 | 2019-02-01 | 290.0 | 145.0 | -145.0 |
1 | 2019-03-01 | 435.0 | 145.0 | -290.0 |
1 | 2019-04-01 | 580.0 | 145.0 | -435.0 |
1 | 2019-05-01 | 725.0 | 580.0 | -145.0 |
1 | 2019-06-01 | 870.0 | 870.0 | 0.0 |