Patent ID: 7469244

Claim:
A method for managing data in an operational datastore and a staging datastore comprising: configuring the staging datastore, comprising: (a) defining a relationship between one or more fields of a first data structure in the staging datastore and one or more fields of a second data structure in the operational datastore, wherein the first data structure is a data source for the second data structure in the operational datastore; and (b) defining a first query comprising at least one field in the first data structure on which the relationship between the data structures is defined, the first query being configured to query and retrieve data from the first data structure; periodically migrating data from the first data structure to the second data structure according to the defined relationship, wherein the migrating occurs in response to a predefined condition being met, wherein the first data structure and the second data structure both include episodic data and wherein the first data structure includes data for currently incomplete episodes and the second data structure only includes data for completed episodes; wherein the predefined condition is completion of an episode; receiving a user defined query configured to query and return data from the second data structure in the operational datastore, wherein the query is configured to request episodic data including data for at least one episode which is currently incomplete; in response to receiving the user defined query, executing the first query to retrieve, from the first data structure, any non-migrated data relevant to the user defined query, the non-migrated data relevant to the user defined query including data relating to the at least one episode which is currently incomplete; in the event any non-migrated data relevant to the user defined query are returned, transforming the returned non-migrated data into a format consistent with the format of the second data structure; generating a temporary data structure in the operational data store; combining the data from the second data structure and the transformed data into the temporary data structure; transforming the user-defined query into a rewritten format capable of execution against the temporary data structure; executing the user defined query in the rewritten format against the temporary data structure; returning results for the executed user defined query, whereby the results include data from the first data structure and the second data structure; and upon completion of the at least one episode, migrating data relating to the at least one episode from the first data structure to the second data structure according to the defined relationship, whereby query results for subsequent user-defined queries for data relating to the at least one episode can be returned from the second data structure without need for a temporary data structure.