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 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
from_currency | to_currency | effective_date | conversion_rate |
---|---|---|---|
USD | INR | 2024-03-01 | 80.00 |
USD | INR | 2024-01-01 | 85.00 |
USD | GBP | 2023-10-01 | 0.80 |
USD | GBP | 2024-03-01 | 0.85 |
USD | AUD | 2023-03-01 | 1.55 |
USD | AUD | 2024-03-01 | 1.60 |
SELECT 6
from_currency | to_currency | effective_date | conversion_rate |
---|---|---|---|
USD | AUD | 2023-03-01 | 1.55 |
USD | GBP | 2023-10-01 | 0.80 |
USD | INR | null | null |
SELECT 3