There should be a lower level functional language describing relations (tables & indices) and operations on them.
I mean, every database has this inside (the query plan - explain), I just want a syntax defined and an API to run queries with it. (For the write path, it might be a bit more complex, but the read operations are straightforward).
Of course SQL is fine as a higher level language. It’s even possible that during development you might record the optimised query plan along with the SQL, and have checks that they match so that you are notified (and can accept/reject) any change (due to existence of an extra index, for example).
I strongly agree with this.
There should be a lower level functional language describing relations (tables & indices) and operations on them.
I mean, every database has this inside (the query plan - explain), I just want a syntax defined and an API to run queries with it. (For the write path, it might be a bit more complex, but the read operations are straightforward).
Of course SQL is fine as a higher level language. It’s even possible that during development you might record the optimised query plan along with the SQL, and have checks that they match so that you are notified (and can accept/reject) any change (due to existence of an extra index, for example).
score 1 · canonical