Abstract: A data storage apparatus (20, 92, 116) includes a data processing unit (24) and multiple storage units (36, 60). Each storage unit includes one or more memory devices (40, 64), which are operative to store a data partition that is drawn from a data structure and assigned to the storage unit, and logic circuitry (44, 68, 72), which is configured to accept one or more sub-queries addressed to the storage unit and to process the respective data partition stored in the storage unit responsively to the sub-queries, so as to produce filtered data. The data processing unit is configured to transform an input query defined over the data structure into the sub-queries, to provide the sub-queries to the storage units, and to process the filtered data produced by the storage units, so as to generate and output a result in response to the input query.