A computer implemented method for storing data sets in and retrieving data
sets from a data storage system in a given number and sorted by a data
attribute of the data set comprises storing data sets each including
one or more attributes in a plurality of binary tree structures (1), each
of said binary tree structures (1) with their nodes (2) representing the
entity of one of the data attributes of the data sets in a sorted manner,
receiving a query for searching and returning data sets according to
query conditions in said given number and sorted by a sort attribute,
accessing the binary tree structure (1) of said sort attribute, serially
traversing the nodes (2) of said binary tree structure (1) according to
the sort attribute, at each node (2) checking whether the data set
associated to said node meets the query conditions and, if true,
returning said data set, terminating said traversing when said given
number of data sets is reached.