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 10
id | code | dt | min_trans | min_rate | max_trans | max_rate |
---|---|---|---|---|---|---|
1 | AAA | 2018-12-01 | 2018120101 | 399 | 2018120104 | 397 |
2 | AAA | 2018-12-02 | 2018120201 | 395 | 2018120206 | 403 |
3 | BBB | 2018-12-01 | 2018120102 | 244 | 2018120102 | 244 |
4 | DDD | 2018-12-02 | 2018120204 | 355 | 2018120204 | 355 |
SELECT 4