Till Westmann has posted comments on this change. Change subject: Convert comparisons with current-datetime, current-date, and current-time to applicable index searches as though they were constants ......................................................................
Patch Set 1: I think that it is important to evaluate the current-time at runtime as a) it is correct and b) it will come back to haunt us when we introduce prepared statements if we do it at compile-time now. But I also think I understand Yingyi's concern. The solution in this patch is not so much based on rules but rather based on exceptions. Instead of creating a exceptional behavior for 3 functions, it would be nice to describe the properties of the expression that we need for the rewritings that were missing, and to build the rules based on those properties. It seems that the property of the expression that we are looking for is, that they return a constant value at runtime. It is a weaker property than a full constant expression, which is constant at compile-time as well and thus can be constant-folded in the optimizer. However, I think that this is the same property that a parameter to a prepared statment or a stored procedure would have. So I think that building the rules based on this property would also help for the implementation of stored procedures. Does this make sense? -- To view, visit https://asterix-gerrit.ics.uci.edu/367 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied64276873afcfbdd31dac313009e47429d8f9b0 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Steven Jacobs <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Preston Carman <[email protected]> Gerrit-Reviewer: Steven Jacobs <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: Yingyi Bu <[email protected]> Gerrit-HasComments: No
