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 CAN4CZFPFhdh+ky-554yMOXo-u8ALgBJKEf_a2vZOtWLuxtKDBw@mail.gmail.com
Whole thread Raw
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
Hello

-  proname => 'time_pl_interval', prorettype => 'time',
-  proargtypes => 'time interval', prosrc => 'time_pl_interval' },
+  proname => 'time_pl_interval', prosupport => 'addition_slope_support',
+  prorettype => 'time', proargtypes => 'time interval',
+  prosrc => 'time_pl_interval' },

I think this is incorrect, time can wrap around and isn't monotonic.

CREATE TABLE time_wrap_test (t time PRIMARY KEY);
INSERT INTO time_wrap_test VALUES
  ('20:00'), ('21:00'), ('22:00'), ('23:00'), ('23:30'),
  ('00:00'), ('01:00'), ('02:00'), ('03:00'), ('04:00');
SELECT t, t + interval '3 hours' AS t_plus_3h
FROM time_wrap_test
ORDER BY t + interval '3 hours';

+ /* Check each index on this relation */
+ foreach(lc, rel->indexlist)
+ {
+ IndexOptInfo *index = (IndexOptInfo *) lfirst(lc);

Isn't a sortopfamily check missing from this?

> Added one line to .gitignore file because I like to keep
> data related to this in the project workarea, e.g.
> ".install", ".dbdata", ".patches", and I don't want those

+
+# ignore hidden files
+.*

This doesn't seem related to the patch.



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: SQL-level pg_datum_image_equal
Next
From: Jeff Davis
Date:
Subject: Re: Use CASEFOLD() internally rather than LOWER()