1. A method for building indices for a time sequence in a time series database, comprising: dividing, using a processing device, a time sequence in the time series database into a plurality of subsequences based on a sliding window; building spatial indices for the plurality of subsequences, the spatial indices being used for defining spatial locations of subsequences in the plurality of subsequences in the time sequence; and building content indices for the plurality of subsequences, the content indices being used for defining content ranges of subsequences in the plurality of subsequences, wherein the building spatial indices for the plurality of subsequences comprises: converting the plurality of subsequences to a frequency domain based on Linear Discrete Transform; and building spatial indices for the plurality of subsequences according to characteristic frequencies in the frequency domain.