Efficient processing of aggregated range queries on two-dimensional grids is a common requirement in information retrieval and data mining systems, for example in Geographic Information Systems and OLAP cubes. We introduce a technique to represent grids supporting aggregated range queries that requires little space when the data points in the grid are clustered, which is common in practice. We show how this general technique can be used to support two important types of aggregated queries, which are ranked range queries and counting range queries. Our experimental evaluation shows that this technique can speed up aggregated queries up to more than an order of magnitude, with a small space overhead. HighlightsSpace-efficient representation for two-dimensional grids.Efficient support for aggregated range queries.Proved performance in main memory.Results competitive with the state of the art.Applications to several domains: Geographic Information Systems, OLAP cubes, etc.
We describe a data structure that uses O(n)-word space and reports k most relevant documents that contain a query pattern P in optimal O(|P| + k) time. Our construction supports an ample set of important relevance measures, such as the frequency of P in a document and the minimal distance between two occurrences of P in a document. We show how to reduce the space of the data structure from O(n log n) to O(n (log σ + log D + log log n)) bits, where σ is the alphabet size and D is the total number of documents.