Relational Algebra by Way of Adjunctions

J Gibbons, Fritz Henglein, Ralf Hinze, Nicolas Wu

Research output: Chapter in Book/Report/Conference proceedingConference Contribution (Conference Proceeding)

9 Citations (Scopus)
305 Downloads (Pure)

Abstract

Bulk types such as sets, bags, and lists are monads, and therefore support a notation for database queries based on comprehensions. This fact is the basis of much work on database query languages. The monadic structure easily explains most of standard relational algebra---specifically, selections and projections---allowing for an elegant mathematical foundation for those aspects of database query language design. Most, but not all: monads do not immediately offer an explanation of relational join or grouping, and hence important foundations for those crucial aspects of relational algebra are missing. The best they can offer is cartesian product followed by selection. Adjunctions come to the rescue: like any monad, bulk types also arise from certain adjunctions; we show that by paying due attention to other important adjunctions, we can elegantly explain the rest of standard relational algebra. In particular, graded monads provide a mathematical foundation for indexing and grouping, which leads directly to an efficient implementation, even of joins.
Original languageEnglish
Title of host publicationProceedings of the International Conference on Functional Programming 2018
PublisherAssociation for Computing Machinery (ACM)
Number of pages28
DOIs
Publication statusPublished - Sept 2018

Fingerprint

Dive into the research topics of 'Relational Algebra by Way of Adjunctions'. Together they form a unique fingerprint.

Cite this