Comments - System-Versioned Tables

5 years, 11 months ago Al Bunch

Is there a way to add add the transaction_end to a transaction_precise versioned table so I can reference it directly without having to join mysql.transaction_registry? In our system I give users a list of dates/times when records were changed, on a normally versioned table if a large change was made that change may span seconds or even minutes so it's difficult to figure out which was the "last" change for a set - transaction precise history fixes that problem but now I have no way of getting that list of dates/times without joining in a table external to the current database.

 
5 years, 11 months ago Sergei Golubchik

Unfortunately, no. The only reason for mysql.transaction_registry to exist is because transaction end cannot be stored directly in the versioned table. (simply, because it's not known at the time of the operation, it is only known at the time of commit, and it wold be too costly to postpone all updates till the commit time)

You can create a view that joins with mysql.transaction_registry so for your users the join will be hidden and implicit.

If it's a question of privileges, you can just grant everyone SELECT privilege on mysql.transaction_registry, and they can join, when needed.

 
5 years, 11 months ago Al Bunch

Not the answer I wanted, but it does make perfect sense. The next best thing would be to somehow put the transaction_registry table directly in the database with the versioned tables themselves so it's at least self-contained.

 
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.