Best practice for open application time period

In part 4 and part 5 of the temporal tables blog series, an Employees table is defined with a PERIOD FOR appl_time (startDate, endDate).

What is the recommended best practice for open application time intervals such as an employee who does not yet have an endDate?

In the blog post, a sentinel date in the future of 2039-08-21 is used. This strategy makes computations such as average tenure complicated, as we'll need logic to detect this value and replace it with the current date.

Ideally we could use some sort of conditional generated column that would take on the value NOW() when an employee is still employed. I don't think that's possible yet though.

Any guidance would be much appreciated!

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.