Skip to content

Add beforeTimestamp and afterTimestamp restriction functions#752

Merged
mschoema merged 2 commits intoMobilityDB:masterfrom
estebanzimanyi:before_after
Feb 1, 2026
Merged

Add beforeTimestamp and afterTimestamp restriction functions#752
mschoema merged 2 commits intoMobilityDB:masterfrom
estebanzimanyi:before_after

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

@estebanzimanyi estebanzimanyi commented Dec 21, 2025

This PR add the new restriction functions beforeTimestamp and afterTimestamp.

The same functionality can be expressed with the functions atTime, startTimestamp, and endTimestamp, for example, in the case of temporal geometric points

beforeTimestamp(tgeompoint, timestamptz) 
afterTimestamp(tgeompoint, timestamptz) 

can be expressed as follows

atTime(tgeompoint, span(startTimestamp(tgeompoint),timestamptz)) 
atTime(tgeompoint, span(timestamptz,endTimestamp(tgeompoint))) 

when

startTimestamp(tgeompoint) <= timestamptz
timestamptz <= endTimestamp(tgeompoint))

and NULL otherwise.

The new functions enable a specialized and a more efficient implementation in addition to facilitate query writing.

@mschoema mschoema merged commit b0fa93f into MobilityDB:master Feb 1, 2026
18 checks passed
@mschoema mschoema deleted the before_after branch February 1, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants