Efficient and scalable search for similar patterns in time series data