I'm looking for a database model to efficiently query the temporal relationship between different events. Where an "event" is an entity with a start and an end date.
Simplified example:
Find all medications that happened during an operation which happened during an admission.
Admission, operation and medications are all "events" but they also have their own specific columns, so traditionally in an RDBMS they are stored in their own tables.
For this example let's say admission, operation and medications have ~10^7 events each.
For an example of how one might try to solve a similar problem in postgres see this question/answer: How to optimize query to compute row-dependent datetime relationships?