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?.
SELECT 3
timestamp | id | event | to_timestamp |
---|---|---|---|
1577863551 | 1 | home | 2020-01-01 07:25:51+00 |
1577863555 | 1 | profile | 2020-01-01 07:25:55+00 |
1577863555 | 2 | home | 2020-01-01 07:25:55+00 |
SELECT 3
dte | distinct_30_days |
---|---|
2020-01-01 00:00:00 | 2 |
2020-02-01 00:00:00 | 0 |
SELECT 2
id | dte | running_ins |
---|---|---|
1 | 2020-01-01 00:00:00 | 2 |
1 | 2020-02-01 00:00:00 | 0 |
2 | 2020-01-01 00:00:00 | 1 |
2 | 2020-02-01 00:00:00 | 0 |
SELECT 4