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
INSERT 0 3
INSERT 0 4
date_1 |
---|
2001-01-01 |
2002-02-02 |
2013-05-05 |
SELECT 3
date_2 |
---|
2004-04-02 |
2006-01-01 |
2012-05-05 |
2014-04-04 |
SELECT 4
max |
---|
2014-04-04 |
SELECT 1