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

From Zsolt Parragi
Subject Re: SLOPE - Planner optimizations on monotonic expressions.
Date
Msg-id CAN4CZFMDq-FMwLQitgAZOWW98R__Ajqy5EzJt3cBLMNtohJQnw@mail.gmail.com
Whole thread
In response to Re: SLOPE - Planner optimizations on monotonic expressions.  (Alexandre Felipe <o.alexandre.felipe@gmail.com>)
Responses Re: SLOPE - Planner optimizations on monotonic expressions.
List pgsql-hackers
I think there's a bug with NULL handling:

CREATE TABLE slope_nulls_test (v int4);
INSERT INTO slope_nulls_test SELECT generate_series(1, 10);
INSERT INTO slope_nulls_test VALUES (NULL), (NULL);
CREATE INDEX slope_nulls_idx ON slope_nulls_test (v ASC NULLS FIRST);
ANALYZE slope_nulls_test;

SET enable_seqscan = off;

SELECT floor(v::float8), v FROM slope_nulls_test ORDER BY 1;

RESET enable_seqscan;
SET enable_indexscan = off;
SELECT floor(v::float8), v FROM slope_nulls_test ORDER BY 1;


 { 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?



pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Return DSA area for hash table from GetNamedDSHash()
Next
From: Haibo Yan
Date:
Subject: Re: Implement missing join selectivity estimation for range types