-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Row History #930
Comments
This is a a very good point and will be very usefull for me :). Thank you for open the feature request! |
Do immudb row versions have start and end timestamp? If so, I'd recommend using the standard SQL(1) syntax for system-period tables(2) instead. MariaDB page is simple, with several examples, but major DBMSs implement more or less the same syntax: This would allow several advantages:
All tables could be system-versioned. In the case of immudb, a user shouldn't have to use any special syntax when a table is created. (1) Actually I don't know if it is standard SQL or just a de facto standard feature. |
Hi @jeroiraz , SELECT * FROM (N? (FORWARD|BACKWARD)? UPDATES (OFFSET M)? AT mytable) That query approach looks good. What if we use alternative more aligned with existing sql SELECT * FROM products WHERE id = 1 LIMIT 1 BACKWARD|FORWARD OFFSET 0; Other than that, I'm wondering how this approach deal with table joins? |
thanks @iambudi for the feedback. In the grammar BACKWARD|FORWARD clauses are close to the data source, as it's specifying how to scan over it. And it will be simpler to implement historical queries over physical tables. Then joins will work as usual but taking into account that the rows fetched from the datasource may contain the same primary key multiple times, once per row update in the specified historical range... |
@jeroiraz thank you, it makes sense. Hope the implementation will soon be started :) |
Hi, i'm curious if this feature has already been started and have ETA? |
What would you like to be added or enhanced
immutability provides a new perspective about changes, actually immutability makes changes explicit as no in-place mutations are made but appended. The final state may be interpreted as the latest appended change or in general, as a function of all updates made to a same entity.
Note: immudb is not just immutable but cryptographically verifiable.
At the SQL layer, immudb provides a special statement for updating rows based on its primary key i.e.
UPSERT
Currently, it's only possible to query the latest row state using standard SQL grammar thus providing a way to query historical row values may be required in order to fetch all the updates made to a given row.
The following illustrative examples may describe a possible approach to solve this problem:
The text was updated successfully, but these errors were encountered: