3 ms·
Can you point to an example please?
by zasdffaa 4y ago
Can you point to an example please?
- ainar-g 4y agoWikipedia has a couple of non-timeseries examples[1]. I guess with timeseries you'd have something along the lines of: user | time_range | status ======+==============+========= 1 | [2018, 2021) | ACTIVE 2 | [2019, ) | ACTIVE 1 | [2021, ) | BLOCKED Where the PK is (user, time_range). (The time_range field being shortened to just year here for simplicity's sake.) In PostgreSQL you can use the tstzrange[2] type. You could also only store one of the timestamps, but that would come at the cost of more complex queries. [1]: https://en.wikipedia.org/wiki/Sixth_normal_form#Examples https://en.wikipedia.org/wiki/Sixth_normal_form#Examples [2]: https://www.postgresql.org/docs/current/rangetypes.html https://www.postgresql.org/docs/current/rangetypes.html