Patent ID: 7739262

Claim:
A computer system that enforces user specified currency constraints on a query on a database system having a query optimizer, a query processing engine and one or more local replicas of data in remote data sources, the computer system comprising: at least one memory; and at least one processing unit, comprising: a constraint parser that interprets and converts the user specified currency constraints into forms usable by the query optimizer, wherein at least one individual user specified currency constraint includes a consistency constraint and the constraint parser parses the consistency constraint; a query plan generator that constructs a query plan for executing the query, wherein the query plan includes one or more subplan selection operators that check a currency of an individual local replica against the at least one individual user specified currency constraint and selects a subplan using the individual local replica only when the at least one individual user specified currency constraint is met; wherein the query processing engine executes the query plan, including the one or more subplan selection operators, thereby producing a result that satisfies the query's currency constraints; and a heartbeat mechanism that includes a global heartbeat table and local replicated heartbeat tables that keep track of at least one individual local replicas currency.