Re: SLOPE - Planner optimizations on monotonic expressions. - Mailing list pgsql-hackers

From Alexandre Felipe
Subject Re: SLOPE - Planner optimizations on monotonic expressions.
Date
Msg-id CAE8JnxM_RsLBWnM9hwN=wyfp16c=q8b-WU8DSjbqBwBc=Jsabw@mail.gmail.com
Whole thread
In response to Re: SLOPE - Planner optimizations on monotonic expressions.  (Zsolt Parragi <zsolt.parragi@percona.com>)
Responses Re: SLOPE - Planner optimizations on monotonic expressions.
List pgsql-hackers

Thank you,
Valuable feedback

On Tue, Apr 7, 2026 at 12:09 AM Zsolt Parragi <zsolt.parragi@percona.com> wrote:

I think there's a bug with NULL handling
I was genuinely surprised that this was not caught by any test in the regression.

There are 32 cases, next patch will verify both the plan and the output
FOR r IN
        SELECT idx_dir, idx_nf, qry_dir, qry_nf, sign
        FROM unnest(ARRAY['+','-']) AS sign,
             unnest(ARRAY['ASC','DESC']) AS idx_dir,
             unnest(ARRAY['FIRST','LAST']) AS idx_nf,
             unnest(ARRAY['ASC','DESC']) AS qry_dir,
             unnest(ARRAY['FIRST','LAST']) AS qry_nf
 

 { oid => '2308', descr => 'nearest integer >= value',
-  proname => 'ceil', prorettype => 'float8', proargtypes => 'float8',
-  prosrc => 'dceil' },
+  proname => 'ceil', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8', prosrc => 'dceil' },
 { oid => '2320', descr => 'nearest integer >= value',
   proname => 'ceiling', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dceil' },

Shouldn't 2320 also have the same change? Same for 1711/2167

 { oid => '183',
-  proname => 'int42mi', prorettype => 'int4', proargtypes => 'int4 int2',
-  prosrc => 'int42mi' },
+  proname => 'int42mi', prosupport => 'diff_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int2', prosrc => 'int42mi' },

Similarly shouldn't int24/int42 mul and div also be included?

Here I am genuinely NOT surprised :) I will take another look there before
submitting the next patch.

Regards,
Alexandre

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: POC: Parallel processing of indexes in autovacuum
Next
From: Magnus Hagander
Date:
Subject: Re: Query Regarding Blog Submission Approval on Planet PostgreSQL