Hacker News new | ask | show | jobs
by twic 4672 days ago
Databases which use MVCC handle (2) - and if they have transactional DDL, then they cover (3). But they don't keep the history permanently. Who wants all that old data?

The one exception to this that i know of is Oracle, which although not fashionable round here, does expose the MVCC log through "flashback queries", where one can simply write "SELECT * FROM USER AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '60' MINUTE)":

http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_...

I don't know what the logistics of keeping an infinite history are. I do know that an e-commerce system i worked with before kept a few days, and that that saved our bacon on a couple of occasions.

2 comments

They have the technological underpinnings, but it's not properly exposed via SQL. In practice you wind up having to do it all by hand.

What the F1 guys seem to have done is said "well that's just silly, let's take advantage of it".

Oracle is my day job, I've been saved by a flashback query once. A DBA misunderstood a request I was making and applied a dev change to production.

> I don't know what the logistics of keeping an infinite history are.

I'd say they're not much different than asking a database developer to be able to generate reports for any given span of time. Or keeping a complete audit trail of changes. Or, more broadly, complete website logs, complete source revision history etc etc.

That is: in theory it creates an infinite downside. In practice it is more valuable than not, especially with the ever-plunging cost of storage.

PostgreSQL used to allow this via "Time Travel", but it has long since been removed (I think because it was rarely used and supporting it interfered with other optimizations.)