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 t(num_r real, num_n numeric);
INSERT INTO t VALUES (0.15, 0.15);
CREATE TABLE
INSERT 0 1
SELECT num_r, num_n
, num_r = num_n AS test1 --> FALSE!
, num_r = num_n::real AS test2 --> TRUE!
, num_r - num_n AS result_nonzero --> float8
, num_r - num_n::real AS result_zero --> real
FROM t;
num_r | num_n | test1 | test2 | result_nonzero | result_zero |
---|---|---|---|---|---|
0.15 | 0.15 | f | t | 5.960464483090178e-09 | 0 |
SELECT 1