[MDEV-17395] REPLACE/INSERT ODKU: support WITHOUT OVERLAPS Created: 2018-10-08 Updated: 2023-11-30 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Nikita Malyavin | Assignee: | Nikita Malyavin |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Replace and Insert ODKU work differently, but both need to cope with Application periods Let's start from use cases. Say, there's an web site hosting hundreds of small online games (like, flash games). Typical ODKU use case (that doesn't use WITHOUT OVERLAPS): count number of players per game. The table could be
And for every player of a specific game we do
Now having WITHOUT OVERLAPS we can count number of players at any specific time. The table could be
and then, for every player
Another example, a hotel booking site, where one can specify a hotel and the date range and then proceed to booking. More often than not visitors don't become customers and don't complete the booking, but, say, we will want to track the demand and record these incomplete bookings. So for every abandoned booking we increment the counter, much like above
This defines the behavior of ODKU. It has to do the INSERT for non-overlapping part of the range and UPDATE for the overlapping part. For example (with hotels):
the result should be
wanted: use cases for REPLACE |
| Comments |
| Comment by Aleksey Midenkov [ 2018-10-25 ] | ||||||
Reproduce
Result
ExpectedNo error. | ||||||
| Comment by Aleksey Midenkov [ 2018-12-17 ] | ||||||
| Comment by Nikita Malyavin [ 2019-11-27 ] | ||||||
|
serg, please review following commits from bb-10.5-MDEV-17395-replace: |