Thread

  1. Re: SLOPE - Planner optimizations on monotonic expressions.

    Alexandre Felipe <o.alexandre.felipe@gmail.com> — 2026-05-07T19:12:25Z

    On Wed, Mar 25, 2026 at 5:18 AM Corey Huinker <corey.huinker@gmail.com>
    wrote:
    > 0002 is missing the catversion bump but that's fine at this early stage.
    
    postponing catversion bump for a time when we get closer to commit,
    v8 doesn't include catversion.h changes, hoping to require less frequent
    rebases.
    
  2. Re: SLOPE - Planner optimizations on monotonic expressions.

    Zsolt Parragi <zsolt.parragi@percona.com> — 2026-05-08T22:18:55Z

    > 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;
    
    
    
    
  3. Re: SLOPE - Planner optimizations on monotonic expressions.

    Alexandre Felipe <o.alexandre.felipe@gmail.com> — 2026-05-10T15:53:49Z

    On Fri, May 8, 2026 at 11:19 PM Zsolt Parragi <zsolt.parragi@percona.com>
    wrote:
    
    > I found one more corner case with infinities (same applies also with
    > negative infinity):
    >
    
    This will restrict a lot of cases.
    
    
    slope_corner_cases.sql enumerate experssions and orders producing
    permutations of (-inf, -1, 0, 1, +inf, nan) mapped to (1,2,3,4,5,6)
    to visualize other similar corner cases.
    
    Apparently the violations boil down to two cases
    * All basic arithmetic operations with infinity constant (with a lucky
    exception x - inf)
    * Every decreasing function where the index key.
    e.g. `-x desc` would have NaNs first
    
    Should I simply detect and disable the above cases?
    
    sqrt(x < 0) already raise an exception, is it safe to assume that for all
    the limited domain functions?