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 9
block_date | address | current_balance | amount | price | avg_acq_price |
---|---|---|---|---|---|
2023-01-01 | A | 5.00 | 5.00 | 10.00 | 10.00 |
2023-01-02 | A | 0.00 | -5.00 | 20.00 | 0.00 |
2023-01-03 | A | 8.00 | 8.00 | 30.00 | 30.00 |
2023-01-04 | A | 10.00 | 2.00 | 40.00 | 32.00 |
2023-01-05 | A | 8.00 | -2.00 | 50.00 | 27.50 |
2023-01-06 | A | 15.00 | 7.00 | 60.00 | 42.67 |
2023-01-07 | A | 11.00 | -4.00 | 70.00 | 32.73 |
2023-01-08 | A | 17.00 | 6.00 | 80.00 | 49.41 |
2023-01-09 | A | 26.00 | 9.00 | 90.00 | 63.46 |
SELECT 9
current_time |
---|
13:27:38+00 |
SELECT 1