> There were too many possibilities for my brain to enumerate, so I scripted > the > extraction and presentation of that in regress/sql/slope.sql in commit 0005.
Apologies, I forgot to reply to this earlier, the new NULL handling looks good. Nice test! I found one more corner case with infinities (same applies also with negative infinity): CREATE TABLE t8 (x float8); INSERT INTO t8 VALUES (-2), (-1), (0), (1), (2); CREATE INDEX t8_x_idx ON t8 (x); ANALYZE t8; SET enable_seqscan = off; SELECT x, x * 'Infinity'::float8 AS f FROM t8 ORDER BY x * 'Infinity'::float8; SET enable_indexscan = off; SET enable_indexonlyscan = off; SET enable_seqscan = on; SELECT x, x * 'Infinity'::float8 AS f FROM t8 ORDER BY x * 'Infinity'::float8;
