3 ms·
On the first point, I don't have either of those books, but IMO the Wikipedia complaints aren't compelling. On the second point, many SQL databases offer index
by paulddraper 8y ago
On the first point, I don't have either of those books, but IMO the Wikipedia complaints aren't compelling.
On the second point, many SQL databases offer indexing [1] (as you said), clustering [2] (arranging a table according an index), and partitioning [3].
I think database designers are very conscious of the difference between the logical relational model and the implementation details. For example, this [4] conversation on the PostgreSQL mailing list about unique indexes vs. unique constraints. I also think that in practice there just aren't many other ways to abstract the logical model from the physical storage that gives you something substantial.
IMO, this is one of the successes of the relational model: the logical model and the physical implementations don't need to differ for you to have a really good situation all around.
[1] https://www.postgresql.org/docs/10/static/indexes-intro.html https://www.postgresql.org/docs/10/static/indexes-intro.html
[2] https://www.postgresql.org/docs/10/static/sql-cluster.html https://www.postgresql.org/docs/10/static/sql-cluster.html
[3] https://www.postgresql.org/docs/10/static/ddl-partitioning.html https://www.postgresql.org/docs/10/static/ddl-partitioning.h...
[4] https://www.postgresql.org/message-id/CAO8h7BJMX5V1TqzScTx2Nr1jH5iUFG8A071y-g1b_kdzpu9PDw%40mail.gmail.com https://www.postgresql.org/message-id/CAO8h7BJMX5V1TqzScTx2N...
- ZenPsycho 8y agothe point is though, it's a little bit like a broken calculator. "The Relational Model" represents a logical model as a kind of pure piece of mathematics, and presents a system that isn't just dump disk persistence but actually a logic induction engine. However, this is not how SQL is used in practice. It is possible to implement the relational model in SQL, however if you assume SQL databases are supposed to be implementations of it in and of themselves, they violate the commutative, associative and distributive laws of the relational algebra- it's a bit like a calculator that sometimes gives you 2+2=5 (because it's faster to give wrong results sometimes). In addition, the ergonomics of a typical SQL database system do not make mathematical/logical soundness the easiest thing to achieve. Most developers don't know or care about logical induction or mathematical soundness, they just want a place to dump their objects. That said, out of the open source SQL database systems, postgresql actually does try to implement the relational model properly. But I don't have enough direct experience with it to say definitively how well it does. How many millions of dollars hss NULL != NULL cost the world?
- paulddraper 8y ago> what is better?
- ZenPsycho 8y agowell, obviously "worse is better". historically, SQL has been "Good enough" and was sponsored by IBM/Oracle that nobody has bothered to try and implement the relational model correctly, except for perhaps postgres (which used to have its own query language before bolting SQL onto its core engine) what I hope people get out of my comments is not about selecting the right system for today- A better thing does not necessarily exist yet-- But at least understand the relational model well enough to see what its utility is. Functional programming and Logic programming are coming back in fashion, and maybe someone here will build the better thing. I don't think "nosql" databases or graph databases are necessarily the better thing. (but they might be for certain usecases). Though I think relational db systems could learn something about developer ergonomics from them. Interfacing with a DB using a fortran inspired query language is archaic. Constructing the queries using string concatenation has been a security nightmare. You could build something waaayyy better off of prolog or mercury, full programming languages with the inductive logic engine at the core of their paradigm, with a database system integrated in, and expose a graphql api for your isomorphic react web app cos that's how we do in 2018. Even microsoft's linq is a massive improvement over using SQL. Language integration, strong typing. These are things we like, right?
- paulddraper 8y ago> well, obviously "worse is better". > A better thing does not necessarily exist yet Ah, of course. > Interfacing with a DB using a fortran inspired query language is archaic. Constructing the queries using string concatenation has been a security nightmare. Perhaps, but this this often for very ubiquitous technologies. See almost every HTML authoring tool. You can write full application servers in Oracle PL/SQL now. [1] And with PostgreSQL's row-level security, you can easily have a GraphQL server with PostGraphile [2]. But those aren't popular solutions. > ou could build something waaayyy better off of prolog or mercury, full programming languages with the inductive logic engine at the core of their paradigm That doesn't really change the equation. You still either have to (1) choose your DBMS's query language to write your application server (like today) or (2) use one language to construct queries in another (like today). I won't argue that a Prolog DBMS wouldn't be nice. I will argue that in terms of the hard parts of a DBMS, it's not going to fundamentally change things. [1] https://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_psp.htm#g2475353 https://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns... [2] https://www.graphile.org/postgraphile/ https://www.graphile.org/postgraphile/