Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQESf-0007Wc-En for pgsql-general@arkaria.postgresql.org; Tue, 14 Sep 2021 19:51:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQESd-0006cY-R2 for pgsql-general@arkaria.postgresql.org; Tue, 14 Sep 2021 19:51:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQESd-0006ay-HF for pgsql-general@lists.postgresql.org; Tue, 14 Sep 2021 19:51:19 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mQESa-000765-M7 for pgsql-general@lists.postgresql.org; Tue, 14 Sep 2021 19:51:19 +0000 Received: by mail-qt1-x82b.google.com with SMTP id m9so137661qtk.4 for ; Tue, 14 Sep 2021 12:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=xFPqh6MKO9j6qAwD+FgYiqBXS4oBlYv7NCNFD4vVUq4=; b=JcF03rZ6gkg9NrGcHhYrc7chd9GX7gM68chvdWjzi98x8vWsa5FiSlAiVncVp0d7rX VyS2ULJYExLQb0Eg2/BCj296z8aFBnD/UPOGEQqmFuJev1J+Ok8RtcXyemPPaGm0mq5v Rg/FzawZscwGjO/WFpAOIMG+Pr3GuO27K+WX25v4PMnAKhCpevOaEH9IeQPAg3FJaubv 0+mqs6tvwC0LsNbCI53dVwXroNS3NNdc1G3Y9ZmGzRMvZLywA6d/i6cTySQZQ7G/J4Mk Dep3XMDz58ykVo6+xU1KdlM9Vp/7IlK/EsS33wdID2jOBsyd4g4B4lbpjAlFP197AHEV Yupg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=xFPqh6MKO9j6qAwD+FgYiqBXS4oBlYv7NCNFD4vVUq4=; b=1N6pK1Ix7wXJ3Y2SacS4xYaeqAdKfhiEVM0jsFwasmRlpBA+mwbTGQtv5hjZADIGzV 48V8UEtsa+Px/OYyR5ohqVECLNILqEIWnHsJRuZNBO3AQ2pzJlEBqACg6eDePb20B3HV /Qm/nsCzOoQP/HbtX9CQxSXcc4t+kwwL5ZF+A7mxX0tE43GkEybAyjObx6iN0wdkjHum sZykxJB9W6f3dwCy7S/n9gKC3F9BkummXxkQ+jLGOKNo+lgPSXj6pDagKVcv1GDOEFW2 BoJXYZI5dI6gV6JNmhDw6tI6/QOuNyeFTE1n86yowd2YzqCikzMBNh3Up9Tzk+7VP6jE KrLQ== X-Gm-Message-State: AOAM530LoUTgmUMJpugRtnw4KC5NrUKKldKLsyJsLJRomimUyRvvolwG f17k7lGpdLrVaeew8FpitcJQrQ6duFupL07M X-Google-Smtp-Source: ABdhPJwYa8zwVZ1EWuOvNIIDOGW2vgT01JipAtz63OzM/IS4aKK6UMf1ASW/IbhylmXHavvs2wUNLQ== X-Received: by 2002:a05:622a:509:: with SMTP id l9mr6467378qtx.355.1631649074155; Tue, 14 Sep 2021 12:51:14 -0700 (PDT) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id w6sm8154537qkf.95.2021.09.14.12.51.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 12:51:13 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------fb2MHnOq8PpTqNR0c6btIGZh" Message-ID: <67f0b6d6-9e8d-a27e-ca7c-e91842338180@gmail.com> Date: Tue, 14 Sep 2021 15:51:13 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: The tragedy of SQL Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <4dc338ad-b0aa-4f4c-bd9c-4dc76dda9e8b@Spark> From: Mladen Gogala In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------fb2MHnOq8PpTqNR0c6btIGZh Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Replies in-line On 9/14/21 01:51, Guyren Howe wrote: > They are making a decent decision. SQL is a *fucking terrible* > language, which I don’t blame them for not wanting to learn. Based on what criteria? > > The whole industry, programming languages, infrastructure, everything > would have developed differently if relations were a natural, > pleasurable thing to use in any programming language. Like an Array, > or a Hash. Thee is nothing natural about either relations or arrays and hashes/dictionaries. Relations are pretty literal implementation of the basic set theory. Having a decent understanding of the basic set theory is a condition  for understanding SQL. Now, we can discuss whether a language implementing a mathematical theory is "good" or "bad", whatever the meaning of "good" or "bad" in the given context. Historically, SQL is a good fit for the banking business and accounting and that is why it is still around. Another misconception about SQL is treating it as a general purpose programming language. SQL is data description language, nothing more, nothing less. It doesn't need loops, arrays, hashes or subroutines, its principal purpose is to describe a subset of data. Without SQL you would have to read all the data and filter the unnecessary stuff yourself. Furthermore, part of SQL are so called "ACID requirements". Transaction can only see the data that was committed before the transaction has begun. Implementing ACID takes a lot of code, that's what MVCC is all about. However, that too has its origins in accounting. You cannot pay the money you don't have. And the last thing about SQL is transaction management. Without relational databases and SQL, you would need a proprietary transaction manager, just like MongoDB. And MongoDB has a complex proprietary transaction manager and is losing market share. So, to recapitulate: * Declarative subset definition * ACID consistency * Transaction management * Ideal fit for accounting. That is why SQL is still around. And that is why we all live in a yellow subroutine (this reference is not for the millennials or younger). -- I'll speak the key, the whole key and nothing but the key, so help me Codd. Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------fb2MHnOq8PpTqNR0c6btIGZh Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Replies in-line

On 9/14/21 01:51, Guyren Howe wrote:
They are making a decent decision. SQL is a *fucking terrible* language, which I don’t blame them for not wanting to learn.

Based on what criteria?



The whole industry, programming languages, infrastructure, everything would have developed differently if relations were a natural, pleasurable thing to use in any programming language. Like an Array, or a Hash.

Thee is nothing natural about either relations or arrays and hashes/dictionaries. Relations are pretty literal implementation of the basic set theory. Having a decent understanding of the basic set theory is a condition  for understanding SQL. Now, we can discuss whether a language implementing a mathematical theory is "good" or "bad", whatever the meaning of "good" or "bad" in the given context. Historically, SQL is a good fit for the banking business and accounting and that is why it is still around.

Another misconception about SQL is treating it as a general purpose programming language. SQL is data description language, nothing more, nothing less. It doesn't need loops, arrays, hashes or subroutines, its principal purpose is to describe a subset of data. Without SQL you would have to read all the data and filter the unnecessary stuff yourself. Furthermore, part of SQL are so called "ACID requirements". Transaction can only see the data that was committed before the transaction has begun. Implementing ACID takes a lot of code, that's what MVCC is all about. However, that too has its origins in accounting. You cannot pay the money you don't have. And the last thing about SQL is transaction management. Without relational databases and SQL, you would need a proprietary transaction manager, just like MongoDB. And MongoDB has a complex proprietary transaction manager and is losing market share. So, to recapitulate:

  • Declarative subset definition
  • ACID consistency
  • Transaction management
  • Ideal fit for accounting.

That is why SQL is still around. And that is why we all live in a yellow subroutine (this reference is not for the millennials or younger).

-- 
I'll speak the key, the whole key and nothing but the key, so help me Codd.
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------fb2MHnOq8PpTqNR0c6btIGZh--