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 5
to_timestamp | date_trunc |
---|---|
2018-03-15 01:00:00+00 | 2018-03-15 01:00:00+00 |
2018-03-15 10:00:00+00 | 2018-03-15 10:00:00+00 |
2018-03-15 11:00:00+00 | 2018-03-15 11:00:00+00 |
2018-03-15 15:00:00+00 | 2018-03-15 15:00:00+00 |
2018-03-15 16:00:00+00 | 2018-03-15 16:00:00+00 |
SELECT 5
missing_hours | key |
---|---|
22 | Source_A |
SELECT 1
key | missing_hours |
---|---|
Source_A | 23 |
Source_B | 22 |
SELECT 2