[SERVER-85006] Handle variable interval boundaries in interval intersection Created: 28/Jul/21  Updated: 12/Jan/24  Resolved: 26/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Timour Katchaounov Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Sprint: QO 2022-03-07, QO 2022-03-21, QO 2022-04-04, QO 2022-04-18, QO 2022-05-02
Participants:

 Description   

WRITING-8202 implements interval intersection when interval boundaries are constants.

This task should extend the intersection logic to handle also variable boundaries.

The approach suggested by svilen.mihaylov is to combine the boundaries of intervals via min/max expressions. For instance (f1 < C) AND (f1 < V) is represented as (f1 < min(C, V)). If both C and V turn out to be constant, then constant folding will fold this into the smaller of the two. If at least on is a variable, then the conjunction is rewritten as as MIN expression, and is propagated further through the optimizer.

A constant folding phase just before execution could fold the min/max boundary expressions into constants.



 Comments   
Comment by Timour Katchaounov [ 26/Apr/22 ]

svilen.mihaylov@mongodb.com it seems you have implemented this. If so, please close this jira accordingly.

Generated at Thu Feb 08 06:56:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.