[MDEV-28383] Implement SQL:2011 WHERE predicates for application-versioned tables (CONTAINS, OVERLAPS, etc.) Created: 2022-04-21  Updated: 2022-05-05  Resolved: 2022-05-05

Status: Closed
Project: MariaDB Server
Component/s: Versioned Tables
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Trevor Gross Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-16976 Support for periods operations Stalled

 Description   

I would like to request the keywords found in section 2.2.3 of "Temporal features in SQL:2011", for DML/DQL of application-versioned tables, be implemented. These include: `CONTAINS`, `OVERLAPS`, `EQUALS`, `PRECEDES`, `SUCCEEDS`, `IMMEDIATELY PRECEDES`, and `IMMEDIATELY SUCCEEDS`.

`CONTAINS` is the most critical, since it is extremely advantageous to be able to query rows that are active now (or at any given point). It is relatively easy to implement in DML (by checking start <= date and end > date), as are all the predicates, but implementing them in the backend would greatly simplify queries.

Sample constructions:

SELECT * from t
WHERE my_period CONTAINS DATE '2011-01-02';
 
SELECT * from t
WHERE my_period OVERLAPS
    PERIOD (DATE '2010-01-01',
    DATE '2011-01-01');



 Comments   
Comment by Trevor Gross [ 2022-05-05 ]

Ah wasn't able to find the original issue, thank you

Generated at Thu Feb 08 10:00:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.