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?.
running_month | year | month |
---|---|---|
1 | 2012 | 4 |
2 | 2012 | 5 |
3 | 2012 | 6 |
4 | 2012 | 7 |
5 | 2012 | 8 |
6 | 2012 | 9 |
7 | 2012 | 10 |
8 | 2012 | 11 |
9 | 2012 | 12 |
10 | 2013 | 1 |
11 | 2013 | 2 |
12 | 2013 | 3 |
13 | 2013 | 4 |
14 | 2013 | 5 |
15 | 2013 | 6 |
16 | 2013 | 7 |
17 | 2013 | 8 |
18 | 2013 | 9 |
19 | 2013 | 10 |
20 | 2013 | 11 |
21 | 2013 | 12 |
22 | 2014 | 1 |
23 | 2014 | 2 |
24 | 2014 | 3 |
25 | 2014 | 4 |
26 | 2014 | 5 |
27 | 2014 | 6 |
28 | 2014 | 7 |
29 | 2014 | 8 |
30 | 2014 | 9 |
31 | 2014 | 10 |
32 | 2014 | 11 |
33 | 2014 | 12 |
34 | 2015 | 1 |
35 | 2015 | 2 |
36 | 2015 | 3 |
37 | 2015 | 4 |
38 | 2015 | 5 |
39 | 2015 | 6 |
40 | 2015 | 7 |
41 | 2015 | 8 |
42 | 2015 | 9 |
43 | 2015 | 10 |
44 | 2015 | 11 |
45 | 2015 | 12 |
46 | 2016 | 1 |
SELECT 46