You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
History applies to the valid time. Facts can be added to the database that apply to any point in time and therefore must be sorted and merged when being evaluated. The following command:
origins history mydomain --start=1492-01-01 --duration=1y --asof=1w
translates to the following query plan:
Get all transactions in mydomain up to 1 week ago from now
For each transaction
Find those that have at least one fact with a valid_time greater than or equal 1492-01-01 or less than 1493-01-01
Sort the facts by valid_time
Filter out facts not in the valid_time range
Merge facts across transactions by valid_time
A few things to consider with this approach:
Determining the set of applicable transactions is an O(n) operation
Transaction facts contain metadata including minValidTime and maxValidTime which are used to determine if the transaction is applicable. The filter function looks like this:
funcfilterTx(tx*Transaction, minT, maxT, minV, maxVint64) bool {
// Not includediftx.TxTime<minT||tx.TxTime>maxT {
returnfalse
}
// At least one fact is known to be within the valid range.returntx.minValidTime>=minV||tx.maxValidTime<=maxV
}
Filter and sort of each transaction can be done in parallel
The text was updated successfully, but these errors were encountered:
History applies to the valid time. Facts can be added to the database that apply to any point in time and therefore must be sorted and merged when being evaluated. The following command:
origins history mydomain --start=1492-01-01 --duration=1y --asof=1w
translates to the following query plan:
mydomain
up to 1 week ago from nowvalid_time
greater than or equal1492-01-01
or less than1493-01-01
valid_time
valid_time
rangevalid_time
A few things to consider with this approach:
minValidTime
andmaxValidTime
which are used to determine if the transaction is applicable. The filter function looks like this:The text was updated successfully, but these errors were encountered: