I will give you an example:
Given a normal select
select * from table mytable where …
If this table has business time support it would be
select * from table mytable as of business_time of ‘2011-01-01’ where …
The syntax extension is in the “from” clause. The above query returns only records valid at ‘2011-01-01’. A simple
select * from table mytable where …
would return all historical versions, this is unwanted in most scenarios. If the date is missing it should be
select * from table mytable as of business_time of current time where …
This select returns all actual versions.
The second dimension is system time support. DB2 uses a second table to store modified and deleted records. This happens completely behind the scenes, no java coding necessary. System time support uses the current time stamp of the operating system.
The select would be
select * from table mytable as of system_time of ‘2011-01-01’ where …
Last not least, you can combine those 2 histories, having a “logical” history and “physical” one. This is called bitemporal and gives you the possibility to reconstruct the logical history on the fly for each physical point in time.
For business time , there are some syntax extensions for delete and update.
delete from mytable for portion of business time from ‘2011-01-01’ to ‘2012-01-01’ where …
For insert statments, you have to specify from and to as usual.
I will stop here, I hope you got the idea.
Cheers
Chrstian
···
On Thu, Nov 21, 2013 at 9:42 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:
–
DI Christian Mueller MSc (GIS), MSc (IT-Security)
OSS Open Source Solutions GmbH
On Thu, Nov 21, 2013 at 9:31 AM, Christian Mueller <christian.mueller@anonymised.com> wrote:
I will investigate within the next weeks but I would feel unhappy to to integrate the is feature only for DB2. (if this is possible). I think your proposal number 2 is thew way to go.
I agree that direction is better. Wondering, do we need to add special API to get the list of intervals for
representing the WMS time dimension?
Right now the code is doing a simple distinct query I believe, but a database with built-in temporal support
will likely just return one range, the one of the currently “valid” record… or not?
Cheers
Andrea
–
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it