[MDEV-33068] Flashback Query Created: 2023-12-19 Updated: 2023-12-21 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | zhangyuan | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
This contribution provides the ability to query the history data for innodb table with the syntax of "SELECT <column_name_list> FROM <table_name> AS OF TIMESTAMP 'time';" Flashback query is implemented based on undo logs. |
| Comments |
| Comment by Andrew Hutchings [ 2023-12-19 ] |
|
We already use this syntax for system versioned tables, which have the advantage that they work for any engine: https://mariadb.com/kb/en/system-versioned-tables/ For InnoDB this can also be used with transaction numbers for more precision. |
| Comment by Yin Peng [ 2023-12-21 ] |
|
Brilliant! We didn't realize that Mariadb had already implemented a similar feature. Perhaps this feature request is no longer necessary. Our implementation differs from Mariadb's. We generate readviews periodically in a background thread, and each readview is associated with a timestamp. To query data for a specific time, we simply need to locate the corresponding readview. |