Are there any mechanisms for aggregating relational storage in the open source query language?

I studied the correct relational algebra, from Christopher's book. Depth Database: Relational Theory for Practitioners . Throughout the book, he uses the language that he and Hugh Darwin invented to convey the theory - Tutorial D. In general, I think that Tutorial D is a very workable query language, much more flexible than SQL, and therefore (just for fun) I was very interested in writing a (ineffective, no doubt) small RDBMS based on Tutorial D, and not SQL.

Understanding that this is a mammoth task, even in order to do something basic, I wonder if there are existing storage systems that do not represent tables in the sense of SQL, but represent relationships in a relational sense and do not assume any specific query language is used to access to data, but simply provides low-level functions such as product , join , intersect , union , project , etc. (at C level, not at the query language level).

Do I make sense? :) Basically, I would like to take something like this and stick with the Tutorial D interface (or the like) in front of it.

It is really easy to do everything in memory, but presenting data structures on a disk in the form in which it is even moderately efficient is quite difficult and probably over my head without serious research.

+4
source share
3 answers

Generic SQL-RDBMS, which use SQL as an interface for structured input between the user and the database engine, use the so-called Query Optimizer, which takes a query expression and generates a set of Execution Plans .

The database runs the most optimal execution plan; which generates the result sets.

So, if you took the open source RDBMS implementation and wanted to change it to adopt a different query language, all you would need to do is translate the query language of your choice into an execution plan.

This does not mean that what you are trying to do is easy. It just needs to be possible, without having to write your own RDBMS. You will need to write a lexer and an interpreter for your query language, and then figure out how to transfer the interpreted query expression to the database engine optimizer so that it can generate execution plans and execute the most efficient ones.

See SQLite as a compact open source relational database engine.

+4
source

Dave Voorhis' Rel is already doing what you want to build.

http://dbappbuilder.sourceforge.net/Rel.php

Unless, of course, you intend to try to build for yourself ...

+3
source

Note that the front end for tutorial D will not be agnostic in the query language;)

My vote also applies to Rel.

Hugh Darwen is approving a list of TTM related projects (a specification for the D language in which the D tutorial is an implementation) I'm sure he would love to hear your efforts if they come to something.

0
source

Source: https://habr.com/ru/post/1379331/


All Articles