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 | Qty | cat_id |
---|---|---|---|
2018 | 10 | 100 | 1 |
2018 | 10 | 0 | 2 |
2018 | 10 | 100 | 3 |
2018 | 10 | 400 | 4 |
2018 | 11 | 0 | 1 |
2018 | 11 | 200 | 2 |
2018 | 11 | 300 | 3 |
2018 | 11 | 400 | 4 |
2018 | 12 | 100 | 1 |
2018 | 12 | 200 | 2 |
2018 | 12 | 300 | 3 |
2018 | 12 | 0 | 4 |