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?.
version |
---|
PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit |
SELECT 1
type | dates | user_id |
---|---|---|
WORK | 2022-06-02 | 74042 |
WORK | 2022-06-02 | 88357 |
WORK | 2022-06-02 | 83902 |
WORK | 2022-06-02 | 88348 |
WORK | 2022-06-03 | 74042 |
WORK | 2022-06-03 | 88357 |
WORK | 2022-06-03 | 83902 |
WORK | 2022-06-03 | 88348 |
LEAVE | 2022-05-16 | 83902 |
LEAVE | 2022-05-16 | 74042 |
LEAVE | 2022-05-16 | 88357 |
LEAVE | 2022-05-16 | 88348 |
LEAVE | 2022-05-26 | 83902 |
LEAVE | 2022-05-26 | 74042 |
LEAVE | 2022-05-26 | 88357 |
LEAVE | 2022-05-26 | 88348 |
SELECT 16