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 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit |
CREATE TABLE mytable (
foo double precision
);
INSERT INTO mytable (foo) VALUES (1.0), (2.378), (42), (23.5);
SELECT foo, sqrt(a) + sqrt(1 - a) AS calc_value
FROM mytable, pow(sin(foo), 2) AS a;
4 rows affected
foo | calc_value |
---|---|
1 | 1.38177329067604 |
2.378 | 1.41387736038013 |
42 | 1.31650686290399 |
23.5 | 1.05998732197382 |