...for the transaction it is a part of (assuming it is the input)?
Does it have to look through the entire block chain to find every instance of that address and see what has been sent to it and what has been taken out of it? If so, man is that going to get processor intensive in the future? It can't be the case but I can't find out how this is accomplished anywhere.