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 mytable (id int, val varchar(5));
insert into mytable(id, val) values(1, 'foo')
1 rows affected
create view myview as select id, val from mytable;
select * from myview;
id | val |
---|---|
1 | foo |
insert into mytable values(2, 'bar');
1 rows affected
select * from myview;
id | val |
---|---|
1 | foo |
2 | bar |