• If I can really simplify it, it comes down to basic stock replenishment. If branch A is out of a certain item (stock), we want to know if the item is in branch B, and if it is we want to supply branch A with that item. Thus, the items (stock) will constantly change. As this query is run constantly we need to know how much stock there is on a certain date at a certain branch.