In-Network Historical Data Storage and Query Processing Based on Distributed Indexing