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?.
4 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
sale_year | sale_month | cat_id |
---|---|---|
2018 | 10 | 1 |
2018 | 10 | 2 |
2018 | 10 | 3 |
2018 | 10 | 4 |
2018 | 11 | 1 |
2018 | 11 | 2 |
2018 | 11 | 3 |
2018 | 11 | 4 |
2018 | 12 | 1 |
2018 | 12 | 2 |
2018 | 12 | 3 |
2018 | 12 | 4 |
sale_year | sale_month | cat_id | Qty |
---|---|---|---|
2018 | 10 | 1 | 100 |
2018 | 10 | 2 | 0 |
2018 | 10 | 3 | 100 |
2018 | 10 | 4 | 400 |
2018 | 11 | 1 | 0 |
2018 | 11 | 2 | 200 |
2018 | 11 | 3 | 300 |
2018 | 11 | 4 | 400 |
2018 | 12 | 1 | 100 |
2018 | 12 | 2 | 200 |
2018 | 12 | 3 | 300 |
2018 | 12 | 4 | 0 |