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 tab
(
counter_date timestamp
);
insert into tab values ('2014-03-14 00:00:00'),
('2014-05-11 00:00:00'),
('2014-11-03 00:00:00'),
('2014-12-23 00:00:00'),
('2015-01-12 00:00:00'),
('2015-08-08 00:00:00'),
('2016-03-14 00:00:00'),
('2017-03-14 00:00:00'),
('2017-03-19 00:00:00');
9 rows affected
select min(counter_date) as oldestDate, max(counter_date) as latestDate from tab;
oldestdate | latestdate |
---|---|
2014-03-14 00:00:00 | 2017-03-19 00:00:00 |