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
CREATE TABLE
id | dateKey |
---|---|
1 | 2023-12-29 |
2 | 2023-12-30 |
3 | 2023-12-31 |
4 | 2024-01-01 |
5 | 2024-01-02 |
6 | 2024-01-03 |
7 | 2024-01-04 |
INSERT 0 7
id | authorId | promptId | content |
---|---|---|---|
1 | 1 | 1 | My content1 |
2 | 1 | 2 | My content2 |
3 | 1 | 5 | My content3 |
4 | 1 | 6 | My content4 |
5 | 2 | 4 | Second user content1 |
6 | 2 | 5 | Second user content2 |
7 | 2 | 6 | Second user content3 |
8 | 2 | 7 | Second user content4 |
9 | 3 | 1 | Third user content1 |
10 | 3 | 2 | Third user content2 |
INSERT 0 10
count |
---|
4 |
SELECT 1