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?.
select version();
version |
---|
PostgreSQL 14.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit |
SELECT 1
create table t(x varchar(100))
CREATE TABLE
insert into t
select 'This is ' || cast(x.* as varchar(20)) || ' string'
from generate_series(1,20) x
INSERT 0 20
select * from t
x |
---|
This is 1 string |
This is 2 string |
This is 3 string |
This is 4 string |
This is 5 string |
This is 6 string |
This is 7 string |
This is 8 string |
This is 9 string |
This is 10 string |
This is 11 string |
This is 12 string |
This is 13 string |
This is 14 string |
This is 15 string |
This is 16 string |
This is 17 string |
This is 18 string |
This is 19 string |
This is 20 string |
SELECT 20