In Proceedings of 5th International Conference on Database
Prague, January 1995.
We investigate and compare two forms of recursion on sets for querying nested collections. The first one is called sri and it corresponds to sequential processing of data. The second one is called sru and it corresponds to data-parallel processing. A uniform first-order translation from sru into sri was known from previous work. The converse translation is by necessity more difficult and we have obtained three main results concerning it. First, we exhibit a uniform translation of sri queries into sru queries over the nested relational algebra. We observe that this translation maps PTIME algorithms into exponential-space queries. The second result proves that any uniform translation of sri queries into sru queries over the nested relational algebra must map some PTIME queries into exponential-space ones. In fact, in the presence of certain external functions, we provide a PTIME sri query for which any equivalent sru query requires exponential space. Thus, as a mechanism for implementing algorithms over complex objects, sru is strictly less powerful than sri. This inefficiency is in contrast to a previous result that uniformly translates efficient sri programs into efficient sru programs, but over a language with higher-order functions. Our third result proves that, in the absence of external functions, higher-order functions do not add more expressive power to the nested relational algebra with sri or sru. However, elimination of higher-order functions cannot be done uniformly, because in the presence of certain external functions, more expressive power can be gained from the higher-order functions. These three results suggest that higher-order functions could be useful in query languages.
See here for the paper.